![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <visual_deck_storage_sort_filter_proxy_model.h>
Public Types | |
| enum | SortOrder { ByName , Alphabetical , ByLastModified , ByLastLoaded } |
| The order in which decks are sorted. Values must match the entries of the sort widget's combo box and the stored settings value. More... | |
| enum | FilterMode { ExactMatch , Includes , Excludes } |
| How the color identity filter is applied. More... | |
Public Member Functions | |
| VisualDeckStorageSortFilterProxyModel (QObject *parent=nullptr) | |
| QVariant | data (const QModelIndex &index, int role) const override |
| void | setSourceModel (QAbstractItemModel *model) override |
| void | setSortOrder (SortOrder order) |
| Sets the sort order and applies it immediately. | |
| void | reapplyFilters () |
| Re-evaluates all matches against the current model data and re-applies filtering and sorting. Called after deck data changes. | |
| void | resort () |
| Re-applies the current sort order without touching the filters. | |
Filter input setters (each re-evaluates the affected matches) | |
| void | setSearchText (const QString &text) |
| void | setTagFilter (const QSet< QString > &newSelectedTags, const QSet< QString > &newExcludedTags) |
| void | setColorFilter (FilterMode mode, const QSet< QChar > &colors) |
Protected Member Functions | |
| bool | filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override |
| bool | lessThan (const QModelIndex &left, const QModelIndex &right) const override |
Private Member Functions | |
| bool | rowMatches (int sourceRow) const |
| void | resizeMatchLists () |
| void | updateSearchMatches () |
| void | updateTagMatches () |
| void | updateColorMatches () |
| const VisualDeckStorageModel * | deckSourceModel () const |
Private Attributes | |
| QString | searchText |
| QSet< QString > | selectedTags |
| QSet< QString > | excludedTags |
| FilterMode | colorFilterMode = ExactMatch |
| QSet< QChar > | activeColors |
| SortOrder | sortOrder = Alphabetical |
| QList< bool > | searchMatches |
| Per-row search match, sized like the source model. | |
| QList< bool > | tagMatches |
| Per-row tag match. | |
| QList< bool > | colorMatches |
| Per-row color identity match. | |
|
explicit |
|
nodiscardoverride |
|
nodiscardprivate |
|
overrideprotected |
|
overrideprotected |
| void VisualDeckStorageSortFilterProxyModel::reapplyFilters | ( | ) |
Re-evaluates all matches against the current model data and re-applies filtering and sorting. Called after deck data changes.
|
private |
| void VisualDeckStorageSortFilterProxyModel::resort | ( | ) |
Re-applies the current sort order without touching the filters.
|
nodiscardprivate |
| void VisualDeckStorageSortFilterProxyModel::setColorFilter | ( | FilterMode | mode, |
| const QSet< QChar > & | colors ) |
| void VisualDeckStorageSortFilterProxyModel::setSearchText | ( | const QString & | text | ) |
| void VisualDeckStorageSortFilterProxyModel::setSortOrder | ( | SortOrder | order | ) |
Sets the sort order and applies it immediately.
|
override |
| void VisualDeckStorageSortFilterProxyModel::setTagFilter | ( | const QSet< QString > & | newSelectedTags, |
| const QSet< QString > & | newExcludedTags ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Per-row color identity match.
|
private |
|
private |
Per-row search match, sized like the source model.
|
private |
|
private |
|
private |
|
private |
Per-row tag match.