![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Inheritance diagram for Digikam::AbstractAlbumModel:Public Types | |
| enum | AlbumDataRole { AlbumTitleRole = Qt::UserRole , AlbumTypeRole = Qt::UserRole + 1 , AlbumPointerRole = Qt::UserRole + 2 , AlbumIdRole = Qt::UserRole + 3 , AlbumGlobalIdRole = Qt::UserRole + 4 , AlbumSortRole = Qt::UserRole + 5 } |
| enum | RootAlbumBehavior { IncludeRootAlbum , IgnoreRootAlbum } |
| AbstractAlbumModel is the abstract base class for all models that present Album objects as managed by AlbumManager. More... | |
Signals | |
| void | rootAlbumAvailable () |
| This is initialized once after creation, if the root album becomes available, if it was not already available at time of construction. | |
Public Member Functions | |
| AbstractAlbumModel (Album::Type albumType, Album *const rootAlbum, RootAlbumBehavior rootBehavior=IncludeRootAlbum, QObject *const parent=nullptr) | |
| Create an AbstractAlbumModel object for albums with the given type. | |
| Album * | albumForIndex (const QModelIndex &index) const |
| Returns the album object associated with the given model index. | |
| Album::Type | albumType () const |
| Returns the Album::Type of the contained albums. | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| AlbumModelDragDropHandler * | dragDropHandler () const |
| Returns the drag drop handler, or 0 if none is installed. | |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| bool | hasChildren (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| QModelIndex | indexForAlbum (Album *album) const |
| Return the QModelIndex for the given album, or an invalid index if the album is not contained in this model. | |
| bool | isFaceTagModel () const |
| Returns true if the album model a face tag model. | |
| QMimeData * | mimeData (const QModelIndexList &indexes) const override |
| QStringList | mimeTypes () const override |
| QModelIndex | parent (const QModelIndex &index) const override |
| Album * | rootAlbum () const |
| RootAlbumBehavior | rootAlbumBehavior () const |
| Returns the root album behavior set for this model. | |
| QModelIndex | rootAlbumIndex () const |
| Return the index corresponding to the root album. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| void | setDragDropHandler (AlbumModelDragDropHandler *handler) |
| Set a drag drop handler. | |
| void | setDropIndex (const QModelIndex &index) |
| Set current index from QDragMoveEvent. | |
| Qt::DropActions | supportedDropActions () const override |
Static Public Member Functions | |
| static Album * | retrieveAlbum (const QModelIndex &index) |
| Returns the album represented by the index. | |
Protected Slots | |
| void | slotAlbumAboutToBeAdded (Album *album, Album *parent, Album *prev) |
| void | slotAlbumAboutToBeDeleted (Album *album) |
| void | slotAlbumAdded (Album *) |
| void | slotAlbumHasBeenDeleted (Album *album) |
| void | slotAlbumIconChanged (Album *album) |
| void | slotAlbumRenamed (Album *album) |
| void | slotAlbumsCleared () |
Protected Member Functions | |
| virtual void | albumCleared (Album *) |
| Notification when an entry is removed. | |
| virtual QVariant | albumData (Album *a, int role) const |
| For subclassing convenience: A part of the implementation of data() | |
| virtual void | allAlbumsCleared () |
| Notification when all entries are removed. | |
| virtual QString | columnHeader () const |
| For subclassing convenience: A part of the implementation of headerData() | |
| virtual QVariant | decorationRoleData (Album *a) const |
| For subclassing convenience: A part of the implementation of data() | |
| virtual bool | filterAlbum (Album *album) const |
| Returns true for those and only those albums that shall be contained in this model. | |
| virtual QVariant | fontRoleData (Album *a) const |
| For subclassing convenience: A part of the implementation of data() | |
| virtual Qt::ItemFlags | itemFlags (Album *album) const |
| For subclassing convenience: A part of the implementation of itemFlags() | |
| void | setEnableDrag (bool enable) |
| Switch on drag and drop globally for all items. | |
| void | setEnableDrop (bool enable) |
| void | setFaceTagModel (bool enable) |
| virtual QVariant | sortRoleData (Album *a) const |
| For subclassing convenience: A part of the implementation of data() | |
| Enumerator | |
|---|---|
| AlbumTitleRole | Returns the album title. Principally the same as display role, but without any additions. |
| AlbumTypeRole | Returns the Album::Type of the associated album. |
| AlbumPointerRole | Returns a pointer to the associated Album object. |
| AlbumIdRole | Returns the id of the associated Album object. |
| AlbumGlobalIdRole | Returns the global id (unique across all album types) |
| AlbumSortRole | Returns the data to sort on. |
You will want to create an instance of the base classes.
|
explicit |
Pass the root album if it is already available. Do not use this class directly, but one of the subclasses.
|
inlineprotectedvirtual |
Reimplemented in Digikam::AbstractCountingAlbumModel, and Digikam::AbstractCheckableAlbumModel.
|
protectedvirtual |
Reimplemented in Digikam::AbstractCountingAlbumModel, Digikam::AbstractCheckableAlbumModel, Digikam::AlbumModel, Digikam::TagModel, and Digikam::SearchModel.
|
inlineprotectedvirtual |
Reimplemented in Digikam::AbstractCountingAlbumModel, and Digikam::AbstractCheckableAlbumModel.
|
protectedvirtual |
Reimplemented in Digikam::AbstractSpecificAlbumModel.
|
protectedvirtual |
Reimplemented in Digikam::AlbumModel, Digikam::TagModel, and Digikam::DateAlbumModel.
|
protectedvirtual |
They must have a common root album, which is set in the constructor.
|
protectedvirtual |
Reimplemented in Digikam::TagModel.
|
static |
In contrast to albumForIndex(), the index can be from any proxy model, as long as an AbstractAlbumModel is at the end.
|
signal |
This is emitted regardless of root album policy.
| QModelIndex Digikam::AbstractAlbumModel::rootAlbumIndex | ( | ) | const |
If the policy is IgnoreRootAlbum, this is an invalid index.
|
protected |
Default is true. For per-item cases reimplement itemFlags().
|
protectedvirtual |
Reimplemented in Digikam::DateAlbumModel.