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

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

## Public Slots
void | checkAllAlbums (const QModelIndex &parent=QModelIndex())
| Checks all albums beneath the given parent.
void | checkAllParentAlbums (const QModelIndex &child)
| Checks all parent albums starting at the child, including it.
void | invertCheckedAlbums (const QModelIndex &parent=QModelIndex())
| Inverts the checked state of all albums under the given parent.
void | resetAllCheckedAlbums ()
| Resets the checked state of all albums to Qt::Unchecked.
void | resetCheckedAlbums (const QModelIndex &parent=QModelIndex())
| Resets the checked state of all albums under the given parent.
void | resetCheckedParentAlbums (const QModelIndex &child)
| Resets the checked state of all parents of the child including it.
void | setChecked (Album *album, bool isChecked)
| Sets the check state of album to Checked or Unchecked.
void | setCheckState (Album *album, Qt::CheckState state)
| Sets the check state of the album.
void | setCheckStateForChildren (Album *album, Qt::CheckState state)
| Sets the checked state recursively for all children of but not for the given album.
void | setCheckStateForParents (Album *album, Qt::CheckState state)
| Sets the checked state recursively for all parents of but not for the given album.
void | toggleChecked (Album *album)
| Toggles the check state of album between Checked or Unchecked.
Public Slots inherited from Digikam::AbstractCountingAlbumModel
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.

## Signals
void | checkStateChanged (Album *album, Qt::CheckState checkState)
| Emitted when the check state of an album changes.
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.

## Public Member Functions
| AbstractCheckableAlbumModel (Album::Type albumType, Album *const rootAlbum, RootAlbumBehavior rootBehavior=IncludeRootAlbum, QObject *const parent=nullptr)
| Abstract base class that manages the check state of Albums.
QList< Album * > | checkedAlbums () const
| Returns a list of album with check state Checked.
Qt::CheckState | checkState (Album *album) const
| Returns the check state of the album.
bool | isAddExcludeTristate () const
bool | isCheckable () const
bool | isChecked (Album *album) const
| Returns if the given album has the check state Checked.
bool | isTristate () const
QList< Album * > | partiallyCheckedAlbums () const
| Returns a list of album with partially check state Checked.
bool | rootIsCheckable () const
void | setAddExcludeTristate (bool b)
| Sets a special tristate mode, which offers the three modes "unchecked", "added" and "excluded", where "excluded" corresponds to partially checked internally, but is reflected in the treeview through the decoration only.
void | setCheckable (bool isCheckable)
| Triggers if the albums in this model are checkable.
void | setRecursive (bool recursive)
| If an item gets checked, all childs get checked as well, If an item gets unchecked, all childs get unchecked as well.
void | setRootCheckable (bool rootIsCheckable)
| Triggers if the root album is checkable.
void | setTristate (bool isTristate)
| Triggers if the albums in this model are tristate.
Public Member Functions inherited from Digikam::AbstractCountingAlbumModel
| 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 Member Functions
void | albumCleared (Album *album) override
| Notification when an entry is removed.
QVariant | albumData (Album *a, int role) const override
| For subclassing convenience: A part of the implementation of data()
void | allAlbumsCleared () override
| Notification when all entries are removed.
Qt::ItemFlags | flags (const QModelIndex &index) const override
void | prepareAddExcludeDecoration (Album *a, QPixmap &icon) const
| If in AddExcludeTristate mode, changes the icon as to indicate the state.
bool | setData (const QModelIndex &index, const QVariant &value, int role, bool recursive)
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Protected Member Functions inherited from Digikam::AbstractCountingAlbumModel
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...
Static Public Member Functions inherited from Digikam::AbstractAlbumModel
static Album * | retrieveAlbum (const QModelIndex &index)
| Returns the album represented by the index.
Protected Slots inherited from Digikam::AbstractCountingAlbumModel
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 Attributes inherited from Digikam::AbstractSpecificAlbumModel
QString | m_columnHeader

## Constructor & Destructor Documentation

## ◆ AbstractCheckableAlbumModel()

Digikam::AbstractCheckableAlbumModel::AbstractCheckableAlbumModel | ( | Album::Type | albumType,
|  | Album *const | rootAlbum,
|  | RootAlbumBehavior | rootBehavior = `IncludeRootAlbum`,
|  | QObject *const | parent = `nullptr`
| ) |  |
| explicit

Call setCheckable(true) to enable checkable albums.

## Member Function Documentation

## ◆ albumCleared()

void Digikam::AbstractCheckableAlbumModel::albumCleared | ( | Album * |  | ) |
| override protected virtual

Reimplemented from Digikam::AbstractAlbumModel.

## ◆ albumData()

QVariant Digikam::AbstractCheckableAlbumModel::albumData | ( | Album * | a,
|  | int | role
| ) |  | const
| override protected virtual

Note
  these can be reimplemented in a subclass

Reimplemented from Digikam::AbstractAlbumModel.

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

## ◆ allAlbumsCleared()

void Digikam::AbstractCheckableAlbumModel::allAlbumsCleared | ( |  | ) |
| override protected virtual

Reimplemented from Digikam::AbstractAlbumModel.

## ◆ checkStateChanged

void Digikam::AbstractCheckableAlbumModel::checkStateChanged | ( | Album * | album,
|  | Qt::CheckState | checkState
| ) |  |
| signal

checkState contains the new Qt::CheckState of album

## ◆ setData()

bool Digikam::AbstractCheckableAlbumModel::setData | ( | const QModelIndex & | index,
|  | const QVariant & | value,
|  | int | role = `Qt::EditRole`
| ) |  |
| override protected

Note
  Do not call this function directly, use the setData(..., bool recursive)

## ◆ setRootCheckable()

void Digikam::AbstractCheckableAlbumModel::setRootCheckable | ( | bool | rootIsCheckable | ) |

Only applicable if the root album is contained at all, and if isCheckable() is true.

## ◆ setTristate()

void Digikam::AbstractCheckableAlbumModel::setTristate | ( | bool | isTristate | ) |

Used to allow the user to actively set a third state, don't use if you only want to display a third state. Note that you want to set setCheckable(true) before.