Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
VisualDeckStorageSortFilterProxyModel Class Reference

#include <visual_deck_storage_sort_filter_proxy_model.h>

Inheritance diagram for VisualDeckStorageSortFilterProxyModel:
[legend]
Collaboration diagram for VisualDeckStorageSortFilterProxyModel:
[legend]

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 VisualDeckStorageModeldeckSourceModel () 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.

Member Enumeration Documentation

◆ FilterMode

How the color identity filter is applied.

Enumerator
ExactMatch 
Includes 
Excludes 

◆ SortOrder

The order in which decks are sorted. Values must match the entries of the sort widget's combo box and the stored settings value.

Enumerator
ByName 
Alphabetical 
ByLastModified 
ByLastLoaded 

Constructor & Destructor Documentation

◆ VisualDeckStorageSortFilterProxyModel()

VisualDeckStorageSortFilterProxyModel::VisualDeckStorageSortFilterProxyModel ( QObject * parent = nullptr)
explicit

Member Function Documentation

◆ data()

QVariant VisualDeckStorageSortFilterProxyModel::data ( const QModelIndex & index,
int role ) const
nodiscardoverride
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deckSourceModel()

const VisualDeckStorageModel * VisualDeckStorageSortFilterProxyModel::deckSourceModel ( ) const
nodiscardprivate
Here is the caller graph for this function:

◆ filterAcceptsRow()

bool VisualDeckStorageSortFilterProxyModel::filterAcceptsRow ( int sourceRow,
const QModelIndex & sourceParent ) const
overrideprotected

◆ lessThan()

bool VisualDeckStorageSortFilterProxyModel::lessThan ( const QModelIndex & left,
const QModelIndex & right ) const
overrideprotected
Here is the call graph for this function:

◆ reapplyFilters()

void VisualDeckStorageSortFilterProxyModel::reapplyFilters ( )

Re-evaluates all matches against the current model data and re-applies filtering and sorting. Called after deck data changes.

Here is the call graph for this function:

◆ resizeMatchLists()

void VisualDeckStorageSortFilterProxyModel::resizeMatchLists ( )
private
Here is the caller graph for this function:

◆ resort()

void VisualDeckStorageSortFilterProxyModel::resort ( )

Re-applies the current sort order without touching the filters.

◆ rowMatches()

bool VisualDeckStorageSortFilterProxyModel::rowMatches ( int sourceRow) const
nodiscardprivate
Here is the caller graph for this function:

◆ setColorFilter()

void VisualDeckStorageSortFilterProxyModel::setColorFilter ( FilterMode mode,
const QSet< QChar > & colors )
Here is the call graph for this function:

◆ setSearchText()

void VisualDeckStorageSortFilterProxyModel::setSearchText ( const QString & text)
Here is the call graph for this function:

◆ setSortOrder()

void VisualDeckStorageSortFilterProxyModel::setSortOrder ( SortOrder order)

Sets the sort order and applies it immediately.

◆ setSourceModel()

void VisualDeckStorageSortFilterProxyModel::setSourceModel ( QAbstractItemModel * model)
override
Here is the call graph for this function:

◆ setTagFilter()

void VisualDeckStorageSortFilterProxyModel::setTagFilter ( const QSet< QString > & newSelectedTags,
const QSet< QString > & newExcludedTags )
Here is the call graph for this function:

◆ updateColorMatches()

void VisualDeckStorageSortFilterProxyModel::updateColorMatches ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSearchMatches()

void VisualDeckStorageSortFilterProxyModel::updateSearchMatches ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTagMatches()

void VisualDeckStorageSortFilterProxyModel::updateTagMatches ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ activeColors

QSet<QChar> VisualDeckStorageSortFilterProxyModel::activeColors
private

◆ colorFilterMode

FilterMode VisualDeckStorageSortFilterProxyModel::colorFilterMode = ExactMatch
private

◆ colorMatches

QList<bool> VisualDeckStorageSortFilterProxyModel::colorMatches
private

Per-row color identity match.

◆ excludedTags

QSet<QString> VisualDeckStorageSortFilterProxyModel::excludedTags
private

◆ searchMatches

QList<bool> VisualDeckStorageSortFilterProxyModel::searchMatches
private

Per-row search match, sized like the source model.

◆ searchText

QString VisualDeckStorageSortFilterProxyModel::searchText
private

◆ selectedTags

QSet<QString> VisualDeckStorageSortFilterProxyModel::selectedTags
private

◆ sortOrder

SortOrder VisualDeckStorageSortFilterProxyModel::sortOrder = Alphabetical
private

◆ tagMatches

QList<bool> VisualDeckStorageSortFilterProxyModel::tagMatches
private

Per-row tag match.


The documentation for this class was generated from the following files: