digiKam Developer Documentation: Digikam::AbstractCountingAlbumModel Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Digikam::AbstractCountingAlbumModel Class Referenceabstract
Inheritance diagram for Digikam::AbstractCountingAlbumModel:

## Public Slots
void | excludeChildrenCount (const QModelIndex &index)
| Displays only the count of the album, without adding child albums' counts.
void | includeChildrenCount (const QModelIndex &index)
| Displays sum of the count of the album and child albums' counts.
void | setCountHash (const QHash< int, int > &idCountHash)
| Enable displaying the count.
void | setShowCount (bool show)
| Call to enable or disable showing the count. Default is false.

## Public Member Functions
| AbstractCountingAlbumModel (Album::Type albumType, Album *const rootAlbum, RootAlbumBehavior rootBehavior=IncludeRootAlbum, QObject *const parent=nullptr)
| Supports displaying a count alongside the album name in DisplayRole.
virtual int | albumCount (Album *album) const
| Returns the number of included items for this album.
bool | showCount () const
Public Member Functions inherited from Digikam::AbstractSpecificAlbumModel
| AbstractSpecificAlbumModel (Album::Type albumType, Album *const rootAlbum, RootAlbumBehavior rootBehavior=IncludeRootAlbum, QObject *const parent=nullptr)
| Abstract base class, do not instantiate.
Public Member Functions inherited from Digikam::AbstractAlbumModel
| 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

## Protected Slots
void | slotAlbumMoved (Album *album)
Protected Slots inherited from Digikam::AbstractSpecificAlbumModel
void | slotGotThumbnailFromIcon (Album *album, const QPixmap &thumbnail)
void | slotReloadThumbnails ()
void | slotThumbnailLost (Album *album)
Protected Slots inherited from Digikam::AbstractAlbumModel
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
void | albumCleared (Album *album) override
| Notification when an entry is removed.
QVariant | albumData (Album *a, int role) const override
| Reimplemented from parent classes.
virtual Album * | albumForId (int id) const =0
| need to implement in subclass
virtual QString | albumName (Album *a) const
| Can reimplement in subclass.
void | allAlbumsCleared () override
| Notification when all entries are removed.
void | setCount (Album *album, int count)
| If you do not use setCountHash, excludeChildrenCount and includeChildrenCount, you can set a count here.
void | setup ()
| Call this method in children class constructors to init signal/slots connections.
Protected Member Functions inherited from Digikam::AbstractSpecificAlbumModel
QString | columnHeader () const override
| For subclassing convenience: A part of the implementation of headerData()
void | emitDataChangedForChildren (Album *album)
virtual void | setColumnHeader (const QString &header)
void | setupThumbnailLoading ()
| You need to call this from your constructor if you intend to load the thumbnail facilities of this class.
Protected Member Functions inherited from Digikam::AbstractAlbumModel
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()

## Additional Inherited Members
Public Types inherited from Digikam::AbstractAlbumModel
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 inherited from Digikam::AbstractAlbumModel
void | rootAlbumAvailable ()
| This is initialized once after creation, if the root album becomes available, if it was not already available at time of construction.
Static Public Member Functions inherited from Digikam::AbstractAlbumModel
static Album * | retrieveAlbum (const QModelIndex &index)
| Returns the album represented by the index.
Protected Attributes inherited from Digikam::AbstractSpecificAlbumModel
QString | m_columnHeader

## Member Function Documentation

## ◆ albumCleared()

void Digikam::AbstractCountingAlbumModel::albumCleared | ( | Album * |  | ) |
| overrideprotectedvirtual

Reimplemented from Digikam::AbstractAlbumModel.

## ◆ albumCount()

int Digikam::AbstractCountingAlbumModel::albumCount | ( | Album * | album | ) | const
| virtual

Returns
  positive value or -1 if unknown

## ◆ albumData()

QVariant Digikam::AbstractCountingAlbumModel::albumData | ( | Album * | a,
|  | int | role
| ) |  | const
| overrideprotectedvirtual

Reimplemented from Digikam::AbstractAlbumModel.

Reimplemented in Digikam::AlbumModel, Digikam::TagModel, and Digikam::SearchModel.

## ◆ albumForId()

virtual Album * Digikam::AbstractCountingAlbumModel::albumForId | ( | int | id | ) | const
| protectedpure virtual

Implemented in Digikam::AlbumModel, Digikam::TagModel, Digikam::SearchModel, and Digikam::DateAlbumModel.

## ◆ albumName()

QString Digikam::AbstractCountingAlbumModel::albumName | ( | Album * | a | ) | const
| protectedvirtual

Reimplemented in Digikam::DateAlbumModel.

## ◆ allAlbumsCleared()

void Digikam::AbstractCountingAlbumModel::allAlbumsCleared | ( |  | ) |
| overrideprotectedvirtual

Reimplemented from Digikam::AbstractAlbumModel.

## ◆ excludeChildrenCount

void Digikam::AbstractCountingAlbumModel::excludeChildrenCount | ( | const QModelIndex & | index | ) |
| slot

This is the default. Can connect to QTreeView's expanded() signal.

## ◆ includeChildrenCount

void Digikam::AbstractCountingAlbumModel::includeChildrenCount | ( | const QModelIndex & | index | ) |
| slot

Can connect to QTreeView's collapsed() signal.

## ◆ setCountHash

void Digikam::AbstractCountingAlbumModel::setCountHash | ( | const QHash< int, int > & | idCountHash | ) |
| slot

Set a map of album id -> count (excluding children). If an album is not contained, no count is displayed. To display a count of 0, there must be an entry album id -> 0.