| 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::SearchFilterModel Class Reference

Filter model for searches that can filter by search type.

Inheritance diagram for Digikam::SearchFilterModel:

## Public Member Functions
| SearchFilterModel (QObject *const parent=nullptr)
bool | isFiltering () const override
| Returns if the currently applied filters will result in any filtering.
void | listAllSearches ()
void | listDuplicatesSearches ()
void | listHaarSearches ()
void | listMapSearches ()
void | listNormalSearches ()
void | listTimelineSearches ()
void | setFilterSearchType (DatabaseSearch::Type)
| Set the DatabaseSearch::Type.
void | setListTemporarySearches (bool list)
| Sets if temporary search albums shall be listed.
void | setSourceSearchModel (SearchModel *const source)
SearchModel * | sourceSearchModel () const
Public Member Functions inherited from Digikam::CheckableAlbumFilterModel
| CheckableAlbumFilterModel (QObject *const parent=nullptr)
void | setFilterChecked (bool filter)
void | setFilterPartiallyChecked (bool filter)
void | setSourceCheckableAlbumModel (AbstractCheckableAlbumModel *const source)
void | setSourceFilterModel (CheckableAlbumFilterModel *const source)
AbstractCheckableAlbumModel * | sourceCheckableAlbumModel () const
Public Member Functions inherited from Digikam::AlbumFilterModel
| AlbumFilterModel (QObject *const parent=nullptr)
Album * | albumForIndex (const QModelIndex &index) const
| Convenience methods.
QVariant | dataForCurrentSortRole (Album *album) const
QModelIndex | indexForAlbum (Album *album) const
QModelIndex | mapFromSourceAlbumModel (const QModelIndex &index) const
QModelIndex | mapToSourceAlbumModel (const QModelIndex &index) const
MatchResult | matchResult (const QModelIndex &index) const
| Returns the MatchResult of an index of this model.
QModelIndex | rootAlbumIndex () const
SearchTextSettings | searchTextSettings () const
| Returns the settings currently used for filtering.
void | setFilterBehavior (FilterBehavior behavior)
| Sets the filter behavior.
void | setSourceAlbumModel (AbstractAlbumModel *const source)
| Sets the source model.
void | setSourceFilterModel (AlbumFilterModel *const source)
| Sets a chained filter model.
AbstractAlbumModel * | sourceAlbumModel () const
AlbumFilterModel * | sourceFilterModel () const
void | updateFilter ()
| Force filter update externally.

## Protected Member Functions
bool | matches (Album *album) const override
| This method provides the basic match checking algorithm.
void | setSourceSearchAlbumModel (AbstractAlbumModel *const source)
void | setTypeFilter (int type)
Protected Member Functions inherited from Digikam::AlbumFilterModel
bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override
bool | lessThan (const QModelIndex &left, const QModelIndex &right) const override
MatchResult | matchResult (Album *album) const
| Returns if the filter matches this album (same logic as filterAcceptsRow).
void | setSourceModel (QAbstractItemModel *const model) override
| Use setSourceAlbumModel.

## Protected Attributes
bool | m_listTemporary = false
int | m_searchType = -1
Protected Attributes inherited from Digikam::CheckableAlbumFilterModel
bool | m_filterChecked = false
bool | m_filterPartiallyChecked = false
Protected Attributes inherited from Digikam::AlbumFilterModel
QPointer< AlbumFilterModel > | m_chainedModel = nullptr
FilterBehavior | m_filterBehavior = FullFiltering
QObject * | m_parent = nullptr
SearchTextSettings | m_settings

## Additional Inherited Members
Public Types inherited from Digikam::AlbumFilterModel
enum | FilterBehavior { SimpleFiltering , FullFiltering , StrictFiltering }
enum | MatchResult { NoMatch = 0 , DirectMatch , ParentMatch , ChildMatch , SpecialMatch }
Public Slots inherited from Digikam::AlbumFilterModel
void | setSearchTextSettings (const SearchTextSettings &settings)
| Accepts new settings used for filtering and applies them to the model.
Signals inherited from Digikam::AlbumFilterModel
void | hasSearchResult (bool hasResult)
| Indicates whether the newly applied filter results in a search result or not.
void | searchTextSettingsAboutToChange (bool searched, bool willSearch)
| This signal indicates that a new SearchTextSettings arrived and is about to be applied to the model.
void | searchTextSettingsChanged (bool wasSearching, bool searched)
| Indicates that new search text settings were applied.
void | signalFilterChanged ()
| Indicates that a new filter was applied to the model.
Static Public Member Functions inherited from Digikam::AlbumFilterModel
template<typename T >
static int | compareByOrder (const T &a, const T &b, Qt::SortOrder sortOrder)
static int | compareByOrder (int compareResult, Qt::SortOrder sortOrder)
| Takes a typical result from a compare method (0 is equal, -1 is less than, 1 is greater than) and applies the given sort order to it.
template<typename T >
static int | compareValue (const T &a, const T &b)
| Returns the usual compare result of -1, 0, or 1 for lessThan, equals and greaterThan.
Protected Slots inherited from Digikam::AlbumFilterModel
void | slotAlbumRenamed (Album *album)
void | slotAlbumsHaveBeenUpdated (int type)

## Member Function Documentation

## ◆ isFiltering()

bool Digikam::SearchFilterModel::isFiltering | ( |  | ) | const
| override virtual

Returns
  `true` if the current selected filter could result in any filtering without checking if this really happens.

Reimplemented from Digikam::CheckableAlbumFilterModel.

## ◆ matches()

bool Digikam::SearchFilterModel::matches | ( | Album * | album | ) | const
| override protected virtual

Return true if this single album matches the current criteria. This method can be overridden to provide custom filtering.

Parameters

  album | the album to tell if it matches the filter criteria or not.

Reimplemented from Digikam::CheckableAlbumFilterModel.