digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::CheckableAlbumFilterModel Class Reference

Filter model for checkable album models that allows more filtering options based on check state.

+ Inheritance diagram for Digikam::CheckableAlbumFilterModel:

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)
 
AbstractCheckableAlbumModelsourceCheckableAlbumModel () const
 
- Public Member Functions inherited from Digikam::AlbumFilterModel
 AlbumFilterModel (QObject *const parent=nullptr)
 
AlbumalbumForIndex (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.
 
AbstractAlbumModelsourceAlbumModel () const
 
AlbumFilterModelsourceFilterModel () const
 
void updateFilter ()
 Force invalidateFilter() externally.
 

Protected Member Functions

bool matches (Album *album) const override
 This method provides the basic match checking algorithm.
 
- 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_filterChecked = false
 
bool m_filterPartiallyChecked = false
 
- Protected Attributes inherited from Digikam::AlbumFilterModel
QPointer< AlbumFilterModelm_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::CheckableAlbumFilterModel::isFiltering ( ) const
overridevirtual
Returns
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.

◆ matches()

bool Digikam::CheckableAlbumFilterModel::matches ( Album album) const
overrideprotectedvirtual

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

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

Reimplemented from Digikam::AlbumFilterModel.

Reimplemented in Digikam::SearchFilterModel, Digikam::TagPropertiesFilterModel, and Digikam::TagsManagerFilterModel.