digiKam
|
Helper class to access data in models. More...
Public Types | |
enum | PropertyFlag { FlagNull = 0 , FlagVisible = 1 , FlagMovable = 2 , FlagSnaps = 4 } |
Signals | |
void | signalModelChangedDrastically () |
void | signalThumbnailAvailableForIndex (const QPersistentModelIndex &index, const QPixmap &pixmap) |
void | signalVisibilityChanged () |
Public Member Functions | |
virtual QPersistentModelIndex | bestRepresentativeIndexFromList (const QList< QPersistentModelIndex > &list, const int sortKey) |
GeoModelHelper (QObject *const parent=nullptr) | |
virtual bool | itemCoordinates (const QModelIndex &index, GeoCoordinates *const coordinates) const =0 |
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... | |
virtual QAbstractItemModel * | model () const =0 |
these are necessary for grouped and ungrouped models More... | |
virtual PropertyFlags | modelFlags () const |
virtual void | onIndicesClicked (const QList< QPersistentModelIndex > &clickedIndices) |
virtual void | onIndicesMoved (const QList< QPersistentModelIndex > &movedIndices, const GeoCoordinates &targetCoordinates, const QPersistentModelIndex &targetSnapIndex) |
virtual QPixmap | pixmapFromRepresentativeIndex (const QPersistentModelIndex &index, const QSize &size) |
these are used by MarkerModel for grouped models More... | |
virtual QItemSelectionModel * | selectionModel () const =0 |
virtual void | snapItemsTo (const QModelIndex &targetIndex, const QList< QModelIndex > &snappedIndices) |
void | snapItemsTo (const QModelIndex &targetIndex, const QList< QPersistentModelIndex > &snappedIndices) |
~GeoModelHelper () override | |
Helper class to access data in models.
GeoModelHelper
is used to access data held in models, which is not suitable for transfer using the the Qt-style API, like coordinates or custom sized thumbnails.
The basic functions which have to be implemented are:
For ungrouped models, the following functions should also be implemented:
For grouped models which are accessed by MarkerModel
, the following functions should be implemented:
|
explicit |
|
override |
|
virtual |
Reimplemented in Digikam::GPSGeoIfaceModelHelper, Digikam::ItemGPSModelHelper, and Digikam::MapViewModelHelper.
|
pure virtual |
Implemented in Digikam::GPSGeoIfaceModelHelper, Digikam::GPSBookmarkModelHelper, Digikam::ItemGPSModelHelper, DigikamGenericGeolocationEditPlugin::SearchResultModelHelper, and Digikam::MapViewModelHelper.
Referenced by Digikam::BackendMarble::findSnapPoint(), Digikam::BackendMarble::marbleCustomPaint(), and Digikam::BackendGoogleMaps::slotUngroupedModelChanged().
|
virtual |
Reimplemented in Digikam::GPSBookmarkModelHelper, and DigikamGenericGeolocationEditPlugin::SearchResultModelHelper.
Referenced by Digikam::BackendGoogleMaps::slotUngroupedModelChanged().
|
virtual |
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.
index | Modelindex of the marker. |
offset | Offset of the zero point in the icon, given from the top-left. |
size | the size of the icon, only populated if a URL is returned. |
pixmap | Holder for the pixmap of the icon. |
url | URL of the icon if available. |
Reimplemented in Digikam::GPSBookmarkModelHelper, and DigikamGenericGeolocationEditPlugin::SearchResultModelHelper.
Referenced by Digikam::BackendMarble::marbleCustomPaint(), and Digikam::BackendGoogleMaps::slotUngroupedModelChanged().
|
pure virtual |
these are necessary for grouped and ungrouped models
Implemented in Digikam::GPSGeoIfaceModelHelper, Digikam::GPSBookmarkModelHelper, Digikam::ItemGPSModelHelper, DigikamGenericGeolocationEditPlugin::SearchResultModelHelper, and Digikam::MapViewModelHelper.
Referenced by Digikam::MapWidget::addUngroupedModel(), Digikam::BackendMarble::findSnapPoint(), Digikam::BackendMarble::marbleCustomPaint(), Digikam::GPSGeoIfaceModelHelper::onIndicesMoved(), Digikam::MapWidget::removeUngroupedModel(), Digikam::ItemMarkerTiler::setMarkerGeoModelHelper(), and Digikam::BackendGoogleMaps::slotUngroupedModelChanged().
|
virtual |
Reimplemented in Digikam::GPSGeoIfaceModelHelper, Digikam::GPSBookmarkModelHelper, and DigikamGenericGeolocationEditPlugin::SearchResultModelHelper.
Referenced by Digikam::BackendMarble::findSnapPoint(), Digikam::BackendMarble::marbleCustomPaint(), and Digikam::BackendGoogleMaps::slotUngroupedModelChanged().
|
virtual |
Reimplemented in Digikam::MapViewModelHelper.
|
virtual |
Reimplemented in Digikam::GPSGeoIfaceModelHelper.
|
virtual |
these are used by MarkerModel for grouped models
Reimplemented in Digikam::GPSGeoIfaceModelHelper, Digikam::ItemGPSModelHelper, and Digikam::MapViewModelHelper.
|
pure virtual |
Implemented in Digikam::GPSGeoIfaceModelHelper, Digikam::GPSBookmarkModelHelper, Digikam::ItemGPSModelHelper, DigikamGenericGeolocationEditPlugin::SearchResultModelHelper, and Digikam::MapViewModelHelper.
Referenced by Digikam::MapWidget::addUngroupedModel(), Digikam::MapWidget::removeUngroupedModel(), and Digikam::ItemMarkerTiler::setMarkerGeoModelHelper().
|
signal |
|
signal |
Referenced by Digikam::ItemMarkerTiler::setMarkerGeoModelHelper().
|
signal |
|
virtual |
Reimplemented in Digikam::GPSBookmarkModelHelper, and DigikamGenericGeolocationEditPlugin::SearchResultModelHelper.
void Digikam::GeoModelHelper::snapItemsTo | ( | const QModelIndex & | targetIndex, |
const QList< QPersistentModelIndex > & | snappedIndices | ||
) |
Referenced by Digikam::GPSGeoIfaceModelHelper::onIndicesMoved().