digiKam Developer Documentation: Digikam::SearchModel Class Reference

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

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

## Public Member Functions
| SearchModel (QObject *const parent=nullptr)
| Create a model containing searches.
void | addReplaceName (const QString &technicalName, const QString &userVisibleName)
SAlbum * | salbumForIndex (const QModelIndex &index) const
void | setDefaultPixmap (const QPixmap &pix)
void | setPixmapForDuplicatesSearches (const QPixmap &pix)
void | setPixmapForHaarSearches (const QPixmap &pix)
void | setPixmapForMapSearches (const QPixmap &pix)
void | setPixmapForNormalSearches (const QPixmap &pix)
| Set pixmaps for the DecorationRole.
void | setPixmapForTimelineSearches (const QPixmap &pix)
void | setReplaceNames (const QHash< QString, QString > &replaceNames)
| Set a hash of internal names (key) that shall be replaced by a user-visible string (value).
Public Member Functions inherited from Digikam::AbstractCheckableAlbumModel
| 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
QVariant | albumData (Album *a, int role) const override
| For subclassing convenience: A part of the implementation of data()
Album * | albumForId (int id) const override
| need to implement in subclass
Protected Member Functions inherited from Digikam::AbstractCheckableAlbumModel
void | albumCleared (Album *album) override
| Notification when an entry is removed.
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.
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()

## Protected Attributes
QHash< int, QPixmap > | m_pixmaps
QHash< QString, QString > | m_replaceNames
Protected Attributes inherited from Digikam::AbstractSpecificAlbumModel
QString | m_columnHeader

## 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...
Public Slots inherited from Digikam::AbstractCheckableAlbumModel
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 inherited from Digikam::AbstractCheckableAlbumModel
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.
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 ()

## Member Function Documentation

## ◆ albumData()

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

Note
  these can be reimplemented in a subclass

Reimplemented from Digikam::AbstractCheckableAlbumModel.

## ◆ albumForId()

Album * Digikam::SearchModel::albumForId | ( | int | id | ) | const
| overrideprotectedvirtual

Implements Digikam::AbstractCountingAlbumModel.

## ◆ setReplaceNames()

void Digikam::SearchModel::setReplaceNames | ( | const QHash< QString, QString > & | replaceNames | ) |

This affects Qt::DisplayRole and AlbumTitleRole.