|
template<typename T > |
static int | compareByOrder (const T &a, const T &b, Qt::SortOrder sortOrder) |
|
static int | compareByOrder (int compareResult, Qt::SortOrder sortOrder) |
|
template<typename T > |
static int | compareValue (const T &a, const T &b) |
|
◆ FilterBehavior
Enumerator |
---|
SimpleFiltering | If an index does not matched, the index and all its children are filtered out. This is the Qt default behavior, but undesirable for album trees.
|
FullFiltering | Default behavior. If an index matches, it is shown, which directly means all its parents are shown as well. In addition, all its children are shown as well.
|
StrictFiltering | If an index matches, it is shown, which directly means all its parents are shown as well. Its children are not shown unless they also match.
|
◆ MatchResult
Enumerator |
---|
NoMatch | This enum can be used as a boolean value if match/no match only is needed.
|
DirectMatch | The index itself is matched.
|
ParentMatch | A parent if the index is matched.
|
ChildMatch | A child of the index is matched.
|
SpecialMatch | The index is matched not because of search settings, but because it has a special type.
|
◆ AlbumFilterModel()
Digikam::AlbumFilterModel::AlbumFilterModel |
( |
QObject *const |
parent = nullptr | ) |
|
|
explicit |
◆ albumForIndex()
Album * Digikam::AlbumFilterModel::albumForIndex |
( |
const QModelIndex & |
index | ) |
const |
Convenience methods.
References Digikam::AbstractAlbumModel::retrieveAlbum().
Referenced by Digikam::AlbumTreeView::albumForIndex(), Digikam::DateTreeView::albumForIndex(), Digikam::TagTreeView::albumForIndex(), Digikam::TagFolderView::contextMenuEvent(), Digikam::AlbumTreeView::currentAlbum(), Digikam::DateTreeView::currentAlbum(), Digikam::SearchTreeView::currentAlbum(), Digikam::TagTreeView::currentAlbum(), Digikam::AbstractAlbumTreeView::doSaveState(), lessThan(), matchResult(), Digikam::AbstractAlbumTreeView::mousePressEvent(), and Digikam::AbstractAlbumTreeView::slotCurrentChanged().
◆ compareByOrder() [1/2]
template<typename T >
static int Digikam::AlbumFilterModel::compareByOrder |
( |
const T & |
a, |
|
|
const T & |
b, |
|
|
Qt::SortOrder |
sortOrder |
|
) |
| |
|
inlinestatic |
◆ compareByOrder() [2/2]
static int Digikam::AlbumFilterModel::compareByOrder |
( |
int |
compareResult, |
|
|
Qt::SortOrder |
sortOrder |
|
) |
| |
|
inlinestatic |
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.
Referenced by lessThan().
◆ compareValue()
template<typename T >
static int Digikam::AlbumFilterModel::compareValue |
( |
const T & |
a, |
|
|
const T & |
b |
|
) |
| |
|
inlinestatic |
Returns the usual compare result of -1, 0, or 1 for lessThan, equals and greaterThan.
◆ dataForCurrentSortRole()
QVariant Digikam::AlbumFilterModel::dataForCurrentSortRole |
( |
Album * |
album | ) |
const |
References Digikam::ApplicationSettings::ByDate, Digikam::ApplicationSettings::ByFolder, Digikam::PAlbum::category(), Digikam::Album::DATE, Digikam::PAlbum::date(), Digikam::ApplicationSettings::getAlbumSortRole(), Digikam::ApplicationSettings::instance(), Digikam::Album::PHYSICAL, Digikam::Album::SEARCH, Digikam::Album::TAG, Digikam::Album::title(), and Digikam::Album::type().
Referenced by lessThan().
◆ filterAcceptsRow()
bool Digikam::AlbumFilterModel::filterAcceptsRow |
( |
int |
source_row, |
|
|
const QModelIndex & |
source_parent |
|
) |
| const |
|
overrideprotected |
◆ hasSearchResult
void Digikam::AlbumFilterModel::hasSearchResult |
( |
bool |
hasResult | ) |
|
|
signal |
Indicates whether the newly applied filter results in a search result or not.
- Parameters
-
hasResult | true if the new filter matches any album, else false |
Referenced by setSearchTextSettings().
◆ indexForAlbum()
QModelIndex Digikam::AlbumFilterModel::indexForAlbum |
( |
Album * |
album | ) |
const |
◆ isFiltering()
bool Digikam::AlbumFilterModel::isFiltering |
( |
| ) |
const |
|
virtual |
◆ lessThan()
bool Digikam::AlbumFilterModel::lessThan |
( |
const QModelIndex & |
left, |
|
|
const QModelIndex & |
right |
|
) |
| const |
|
overrideprotected |
Implementation to sort Tags that contain Unconfirmed Faces, according to the Unconfirmed Face Count.
References Digikam::ItemSortCollator::albumCompare(), albumForIndex(), Digikam::ApplicationSettings::ByCategory, Digikam::ApplicationSettings::ByDate, compareByOrder(), dataForCurrentSortRole(), Digikam::ApplicationSettings::getAlbumSortRole(), Digikam::AlbumManager::getUnconfirmedFaceCount(), Digikam::Album::id(), Digikam::FaceTags::ignoredPersonTagId(), Digikam::AlbumManager::instance(), Digikam::ItemSortCollator::instance(), Digikam::ApplicationSettings::instance(), Digikam::AbstractAlbumModel::isFaceTagModel(), Digikam::ApplicationSettings::isStringTypeNatural(), Digikam::Album::isTrashAlbum(), sourceAlbumModel(), Digikam::Album::TAG, Digikam::Album::type(), Digikam::FaceTags::unconfirmedPersonTagId(), and Digikam::FaceTags::unknownPersonTagId().
◆ mapFromSourceAlbumModel()
QModelIndex Digikam::AlbumFilterModel::mapFromSourceAlbumModel |
( |
const QModelIndex & |
index | ) |
const |
◆ mapToSourceAlbumModel()
QModelIndex Digikam::AlbumFilterModel::mapToSourceAlbumModel |
( |
const QModelIndex & |
index | ) |
const |
◆ matches()
bool Digikam::AlbumFilterModel::matches |
( |
Album * |
album | ) |
const |
|
protectedvirtual |
This method provides the basic match checking algorithm. 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 in Digikam::TagsManagerFilterModel, Digikam::TagPropertiesFilterModel, Digikam::SearchFilterModel, and Digikam::CheckableAlbumFilterModel.
References Digikam::AbstractAlbumModel::AlbumTitleRole, Digikam::SearchTextSettings::caseSensitive, Digikam::AbstractAlbumModel::indexForAlbum(), m_chainedModel, m_settings, sourceAlbumModel(), and Digikam::SearchTextSettings::text.
Referenced by Digikam::CheckableAlbumFilterModel::matches(), and matchResult().
◆ matchResult() [1/2]
Returns if the filter matches this album (same logic as filterAcceptsRow). An album matches if the search text settings are found in a parent album's title, in the album's title or in a child album's title, or if it is a special album (root) that is never filtered out.
References ChildMatch, Digikam::AlbumIterator::current(), DirectMatch, FullFiltering, Digikam::PAlbum::isAlbumRoot(), Digikam::TAlbum::isInternalTag(), Digikam::Album::isRoot(), m_filterBehavior, matches(), NoMatch, Digikam::Album::parent(), ParentMatch, SimpleFiltering, and SpecialMatch.
◆ matchResult() [2/2]
◆ rootAlbumIndex()
QModelIndex Digikam::AlbumFilterModel::rootAlbumIndex |
( |
| ) |
const |
◆ searchTextSettings()
Returns the settings currently used for filtering.
- Returns
- current settings for filtering.
References m_settings.
◆ searchTextSettingsAboutToChange
void Digikam::AlbumFilterModel::searchTextSettingsAboutToChange |
( |
bool |
searched, |
|
|
bool |
willSearch |
|
) |
| |
|
signal |
This signal indicates that a new SearchTextSettings arrived and is about to be applied to the model.
- Parameters
-
searched | true if filtering by text was enabled before applying the new settings |
willSearch | true if the new settings can result in any filtering by text, else false . |
Referenced by setSearchTextSettings().
◆ searchTextSettingsChanged
void Digikam::AlbumFilterModel::searchTextSettingsChanged |
( |
bool |
wasSearching, |
|
|
bool |
searched |
|
) |
| |
|
signal |
Indicates that new search text settings were applied.
- Parameters
-
wasSearching | true if this is not a new search that |
searched | true if the new settings result in any filtering |
Referenced by setSearchTextSettings().
◆ setFilterBehavior()
void Digikam::AlbumFilterModel::setFilterBehavior |
( |
FilterBehavior |
behavior | ) |
|
Sets the filter behavior. Default is FullFiltering.
References m_filterBehavior.
◆ setSearchTextSettings
void Digikam::AlbumFilterModel::setSearchTextSettings |
( |
const SearchTextSettings & |
settings | ) |
|
|
slot |
◆ setSourceAlbumModel()
◆ setSourceFilterModel()
void Digikam::AlbumFilterModel::setSourceFilterModel |
( |
AlbumFilterModel *const |
source | ) |
|
◆ setSourceModel()
void Digikam::AlbumFilterModel::setSourceModel |
( |
QAbstractItemModel *const |
model | ) |
|
|
overrideprotected |
◆ signalFilterChanged
void Digikam::AlbumFilterModel::signalFilterChanged |
( |
| ) |
|
|
signal |
◆ slotAlbumRenamed
void Digikam::AlbumFilterModel::slotAlbumRenamed |
( |
Album * |
album | ) |
|
|
protectedslot |
◆ slotAlbumsHaveBeenUpdated
void Digikam::AlbumFilterModel::slotAlbumsHaveBeenUpdated |
( |
int |
type | ) |
|
|
protectedslot |
◆ sourceAlbumModel()
◆ sourceFilterModel()
◆ updateFilter()
void Digikam::AlbumFilterModel::updateFilter |
( |
| ) |
|
◆ m_chainedModel
◆ m_filterBehavior
◆ m_parent
QObject* Digikam::AlbumFilterModel::m_parent |
|
protected |
◆ m_settings
The documentation for this class was generated from the following files: