![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Filter model for checkable album models that allows more filtering options based on check state.
Public Member Functions | |
CheckableAlbumFilterModel (QObject *const parent=nullptr) | |
bool | isFiltering () const override |
Returns if the currently applied filters will result in any filtering. | |
void | setFilterChecked (bool filter) |
void | setFilterPartiallyChecked (bool filter) |
void | setSourceCheckableAlbumModel (AbstractCheckableAlbumModel *const source) |
void | setSourceFilterModel (CheckableAlbumFilterModel *const source) |
AbstractCheckableAlbumModel * | sourceCheckableAlbumModel () const |
![]() | |
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 invalidateFilter() externally. | |
Protected Member Functions | |
bool | matches (Album *album) const override |
This method provides the basic match checking algorithm. | |
![]() | |
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_filterChecked = false |
bool | m_filterPartiallyChecked = false |
![]() | |
QPointer< AlbumFilterModel > | m_chainedModel = nullptr |
FilterBehavior | m_filterBehavior = FullFiltering |
QObject * | m_parent = nullptr |
SearchTextSettings | m_settings |
Additional Inherited Members | |
![]() | |
enum | FilterBehavior { SimpleFiltering , FullFiltering , StrictFiltering } |
enum | MatchResult { NoMatch = 0 , DirectMatch , ParentMatch , ChildMatch , SpecialMatch } |
![]() | |
void | setSearchTextSettings (const SearchTextSettings &settings) |
Accepts new settings used for filtering and applies them to the model. | |
![]() | |
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. | |
![]() | |
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. | |
![]() | |
void | slotAlbumRenamed (Album *album) |
void | slotAlbumsHaveBeenUpdated (int type) |
|
overridevirtual |
true
if the current selected filter could result in any filtering without checking if this really happens. Reimplemented from Digikam::AlbumFilterModel.
Reimplemented in Digikam::SearchFilterModel, and Digikam::TagPropertiesFilterModel.
|
overrideprotectedvirtual |
Return true if this single album matches the current criteria. This method can be overridden to provide custom filtering.
album | the album to tell if it matches the filter criteria or not. |
Reimplemented from Digikam::AlbumFilterModel.
Reimplemented in Digikam::SearchFilterModel, Digikam::TagPropertiesFilterModel, and Digikam::TagsManagerFilterModel.