digiKam
Digikam::MapViewModelHelper Class Reference
+ Inheritance diagram for Digikam::MapViewModelHelper:

Public Types

enum  PropertyFlag { FlagNull = 0 , FlagVisible = 1 , FlagMovable = 2 , FlagSnaps = 4 }
 

Signals

void signalFilteredImages (const QList< qlonglong > &idList)
 
void signalModelChangedDrastically ()
 
void signalThumbnailAvailableForIndex (const QPersistentModelIndex &index, const QPixmap &pixmap)
 
void signalVisibilityChanged ()
 

Public Member Functions

QPersistentModelIndex bestRepresentativeIndexFromList (const QList< QPersistentModelIndex > &list, const int sortKey) override
 This function finds the best representative marker from a group of markers. This is needed to display a thumbnail for a marker group. More...
 
bool itemCoordinates (const QModelIndex &index, GeoCoordinates *const coordinates) const override
 Gets the coordinates of a marker found at current model index. More...
 
virtual PropertyFlags itemFlags (const QModelIndex &index) const
 
virtual bool itemIcon (const QModelIndex &index, QPoint *const offset, QSize *const size, QPixmap *const pixmap, QUrl *const url) const
 these are necessary for ungrouped models More...
 
 MapViewModelHelper (QItemSelectionModel *const selection, DCategorizedSortFilterProxyModel *const filterModel, QObject *const parent, const MapWidgetView::Application application)
 
QAbstractItemModel * model () const override
 
virtual PropertyFlags modelFlags () const
 
void onIndicesClicked (const QList< QPersistentModelIndex > &clickedIndices) override
 
virtual void onIndicesMoved (const QList< QPersistentModelIndex > &movedIndices, const GeoCoordinates &targetCoordinates, const QPersistentModelIndex &targetSnapIndex)
 
QPixmap pixmapFromRepresentativeIndex (const QPersistentModelIndex &index, const QSize &size) override
 This function retrieves the thumbnail for an index. More...
 
QItemSelectionModel * selectionModel () const override
 
virtual void snapItemsTo (const QModelIndex &targetIndex, const QList< QModelIndex > &snappedIndices)
 
void snapItemsTo (const QModelIndex &targetIndex, const QList< QPersistentModelIndex > &snappedIndices)
 
 ~MapViewModelHelper () override
 Destructor. More...
 

Member Enumeration Documentation

◆ PropertyFlag

Enumerator
FlagNull 
FlagVisible 
FlagMovable 
FlagSnaps 

Constructor & Destructor Documentation

◆ MapViewModelHelper()

Digikam::MapViewModelHelper::MapViewModelHelper ( QItemSelectionModel *const  selection,
DCategorizedSortFilterProxyModel *const  filterModel,
QObject *const  parent,
const MapWidgetView::Application  application 
)
explicit

◆ ~MapViewModelHelper()

Digikam::MapViewModelHelper::~MapViewModelHelper ( )
override

Destructor.

Member Function Documentation

◆ bestRepresentativeIndexFromList()

QPersistentModelIndex Digikam::MapViewModelHelper::bestRepresentativeIndexFromList ( const QList< QPersistentModelIndex > &  list,
const int  sortKey 
)
overridevirtual

This function finds the best representative marker from a group of markers. This is needed to display a thumbnail for a marker group.

Parameters
indicesA list containing markers.
sortKeyDetermines the sorting options and is actually of type GPSItemInfoSorter::SortOptions
Returns
Returns the index of the marker.

Reimplemented from Digikam::GeoModelHelper.

References Digikam::MapWidgetView::ApplicationDigikam, Digikam::MapWidgetView::ApplicationImportUI, Digikam::GPSItemInfo::coordinates, Digikam::GPSItemInfo::dateTime, Digikam::GPSItemInfoSorter::fitsBetter(), Digikam::GPSItemInfo::rating, Digikam::SelectedNone, Digikam::GeoCoordinates::setAlt(), Digikam::GPSItemInfo::url, and Digikam::CamItemInfo::url().

◆ itemCoordinates()

bool Digikam::MapViewModelHelper::itemCoordinates ( const QModelIndex &  index,
GeoCoordinates *const  coordinates 
) const
overridevirtual

Gets the coordinates of a marker found at current model index.

Parameters
indexCurrent model index.
coordinatesHere will be returned the coordinates of the current marker.
Returns
True, if the marker has coordinates.

Implements Digikam::GeoModelHelper.

References Digikam::MapWidgetView::ApplicationDigikam, Digikam::MapWidgetView::ApplicationImportUI, Digikam::ItemInfo::hasCoordinates(), Digikam::ItemInfo::isNull(), Digikam::CamItemInfo::isNull(), Digikam::ItemInfo::latitudeNumber(), Digikam::ItemInfo::longitudeNumber(), Digikam::GeoCoordinates::setAlt(), and Digikam::CamItemInfo::url().

◆ itemFlags()

GeoModelHelper::PropertyFlags Digikam::GeoModelHelper::itemFlags ( const QModelIndex &  index) const
virtualinherited

◆ itemIcon()

bool Digikam::GeoModelHelper::itemIcon ( const QModelIndex &  index,
QPoint *const  offset,
QSize *const  size,
QPixmap *const  pixmap,
QUrl *const  url 
) const
virtualinherited

these are necessary for ungrouped models

Returns the icon for an ungrouped marker.

The icon can either be returned as a URL to an image, or as a QPixmap. If the caller can handle URLs (for example, to display them in HTML), he can provide the URL parameter. However, the GeoModelHelper may still choose to return a QPixmap instead, if no URL is available.

Parameters
indexModelindex of the marker.
offsetOffset of the zero point in the icon, given from the top-left.
sizethe size of the icon, only populated if a URL is returned.
pixmapHolder for the pixmap of the icon.
urlURL of the icon if available.

Reimplemented in Digikam::GPSBookmarkModelHelper, and DigikamGenericGeolocationEditPlugin::SearchResultModelHelper.

Referenced by Digikam::BackendMarble::marbleCustomPaint(), and Digikam::BackendGoogleMaps::slotUngroupedModelChanged().

◆ model()

QAbstractItemModel * Digikam::MapViewModelHelper::model ( ) const
overridevirtual
Returns
Returns digiKam's filter model.

Implements Digikam::GeoModelHelper.

References Digikam::MapWidgetView::ApplicationDigikam, and Digikam::MapWidgetView::ApplicationImportUI.

◆ modelFlags()

◆ onIndicesClicked()

void Digikam::MapViewModelHelper::onIndicesClicked ( const QList< QPersistentModelIndex > &  clickedIndices)
overridevirtual

This functions is called when one clicks on a thumbnail.

Parameters
clickedIndicesA list containing the marker indices belonging the group whose thumbnail has been clicked.

Reimplemented from Digikam::GeoModelHelper.

References signalFilteredImages().

◆ onIndicesMoved()

void Digikam::GeoModelHelper::onIndicesMoved ( const QList< QPersistentModelIndex > &  movedIndices,
const GeoCoordinates targetCoordinates,
const QPersistentModelIndex &  targetSnapIndex 
)
virtualinherited

◆ pixmapFromRepresentativeIndex()

QPixmap Digikam::MapViewModelHelper::pixmapFromRepresentativeIndex ( const QPersistentModelIndex &  index,
const QSize &  size 
)
overridevirtual

This function retrieves the thumbnail for an index.

Parameters
indexThe marker's index.
sizeThe size of the thumbnail.
Returns
If the thumbnail has been loaded in the ThumbnailLoadThread instance, it is returned. If not, a QPixmap is returned and ThumbnailLoadThread's signal named signalThumbnailLoaded is emitted when the thumbnail becomes available.

Reimplemented from Digikam::GeoModelHelper.

References Digikam::MapWidgetView::ApplicationDigikam, Digikam::MapWidgetView::ApplicationImportUI, Digikam::ItemInfo::isNull(), Digikam::ItemInfo::thumbnailIdentifier(), and Digikam::ImportItemModel::ThumbnailRole.

◆ selectionModel()

QItemSelectionModel * Digikam::MapViewModelHelper::selectionModel ( ) const
overridevirtual
Returns
Returns digiKam's selection model.

Implements Digikam::GeoModelHelper.

◆ signalFilteredImages

void Digikam::MapViewModelHelper::signalFilteredImages ( const QList< qlonglong > &  idList)
signal

Referenced by onIndicesClicked().

◆ signalModelChangedDrastically

void Digikam::GeoModelHelper::signalModelChangedDrastically ( )
signalinherited

◆ signalThumbnailAvailableForIndex

void Digikam::GeoModelHelper::signalThumbnailAvailableForIndex ( const QPersistentModelIndex &  index,
const QPixmap &  pixmap 
)
signalinherited

◆ signalVisibilityChanged

void Digikam::GeoModelHelper::signalVisibilityChanged ( )
signalinherited

◆ snapItemsTo() [1/2]

void Digikam::GeoModelHelper::snapItemsTo ( const QModelIndex &  targetIndex,
const QList< QModelIndex > &  snappedIndices 
)
virtualinherited

◆ snapItemsTo() [2/2]

void Digikam::GeoModelHelper::snapItemsTo ( const QModelIndex &  targetIndex,
const QList< QPersistentModelIndex > &  snappedIndices 
)
inherited

The documentation for this class was generated from the following files: