Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardDatabaseDisplayModel Class Reference

#include <card_database_display_model.h>

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

Public Types

enum  FilterBool { ShowTrue , ShowFalse , ShowAll }

Signals

void modelDirty ()

Public Member Functions

 CardDatabaseDisplayModel (QObject *parent=nullptr)
void setFilterTree (FilterTree *_filterTree)
void setIsToken (FilterBool _isToken)
void setCardName (const QString &_cardName)
void setStringFilter (const QString &_src)
void setCardNameSet (const QSet< QString > &_cardNameSet)
void dirty ()
void clearFilterAll ()
int rowCount (const QModelIndex &parent=QModelIndex()) const override
bool canFetchMore (const QModelIndex &parent) const override
void fetchMore (const QModelIndex &parent) override

Protected Member Functions

bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
bool rowMatchesCardName (CardInfoPtr info) const

Static Protected Member Functions

static int lessThanNumerically (const QString &left, const QString &right)

Private Slots

void filterTreeChanged ()
const QString sanitizeCardName (const QString &dirtyName, const QMap< wchar_t, wchar_t > &table)

Private Attributes

FilterBool isToken
QString cardName
QString cardText
QSet< QString > cardNameSet
QSet< QString > cardTypes
QSet< QString > cardColors
FilterTreefilterTree
FilterStringfilterString
int loadedRowCount
QTimer dirtyTimer

Static Private Attributes

static QMap< wchar_t, wchar_t > characterTranslation

Member Enumeration Documentation

◆ FilterBool

Enumerator
ShowTrue 
ShowFalse 
ShowAll 

Constructor & Destructor Documentation

◆ CardDatabaseDisplayModel()

CardDatabaseDisplayModel::CardDatabaseDisplayModel ( QObject * parent = nullptr)
explicit
Here is the caller graph for this function:

Member Function Documentation

◆ canFetchMore()

bool CardDatabaseDisplayModel::canFetchMore ( const QModelIndex & parent) const
nodiscardoverride

◆ clearFilterAll()

void CardDatabaseDisplayModel::clearFilterAll ( )

◆ dirty()

void CardDatabaseDisplayModel::dirty ( )
inline
Here is the caller graph for this function:

◆ fetchMore()

void CardDatabaseDisplayModel::fetchMore ( const QModelIndex & parent)
override
Here is the call graph for this function:

◆ filterAcceptsRow()

bool CardDatabaseDisplayModel::filterAcceptsRow ( int sourceRow,
const QModelIndex & sourceParent ) const
nodiscardoverrideprotected
Here is the call graph for this function:

◆ filterTreeChanged

void CardDatabaseDisplayModel::filterTreeChanged ( )
privateslot
Here is the caller graph for this function:

◆ lessThan()

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

◆ lessThanNumerically()

int CardDatabaseDisplayModel::lessThanNumerically ( const QString & left,
const QString & right )
staticprotected
Here is the caller graph for this function:

◆ modelDirty

void CardDatabaseDisplayModel::modelDirty ( )
signal
Here is the caller graph for this function:

◆ rowCount()

int CardDatabaseDisplayModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
nodiscardoverride
Here is the caller graph for this function:

◆ rowMatchesCardName()

bool CardDatabaseDisplayModel::rowMatchesCardName ( CardInfoPtr info) const
nodiscardprotected
Here is the caller graph for this function:

◆ sanitizeCardName

const QString CardDatabaseDisplayModel::sanitizeCardName ( const QString & dirtyName,
const QMap< wchar_t, wchar_t > & table )
privateslot

Will translate all undesirable characters in DIRTYNAME according to the TABLE.

Here is the caller graph for this function:

◆ setCardName()

void CardDatabaseDisplayModel::setCardName ( const QString & _cardName)
inline
Here is the call graph for this function:

◆ setCardNameSet()

void CardDatabaseDisplayModel::setCardNameSet ( const QSet< QString > & _cardNameSet)
inline
Here is the call graph for this function:

◆ setFilterTree()

void CardDatabaseDisplayModel::setFilterTree ( FilterTree * _filterTree)
Here is the call graph for this function:

◆ setIsToken()

void CardDatabaseDisplayModel::setIsToken ( FilterBool _isToken)
inline
Here is the call graph for this function:

◆ setStringFilter()

void CardDatabaseDisplayModel::setStringFilter ( const QString & _src)
inline
Here is the call graph for this function:

Member Data Documentation

◆ cardColors

QSet<QString> CardDatabaseDisplayModel::cardColors
private

◆ cardName

QString CardDatabaseDisplayModel::cardName
private

◆ cardNameSet

QSet<QString> CardDatabaseDisplayModel::cardNameSet
private

◆ cardText

QString CardDatabaseDisplayModel::cardText
private

◆ cardTypes

QSet<QString> CardDatabaseDisplayModel::cardTypes
private

◆ characterTranslation

QMap< wchar_t, wchar_t > CardDatabaseDisplayModel::characterTranslation
staticprivate
Initial value:
= {{L'“', L'\"'},
{L'”', L'\"'},
{L'‘', L'\''},
{L'’', L'\''}}

The translation table that will be used for sanitizeCardName.

◆ dirtyTimer

QTimer CardDatabaseDisplayModel::dirtyTimer
private

◆ filterString

FilterString* CardDatabaseDisplayModel::filterString
private

◆ filterTree

FilterTree* CardDatabaseDisplayModel::filterTree
private

◆ isToken

FilterBool CardDatabaseDisplayModel::isToken
private

◆ loadedRowCount

int CardDatabaseDisplayModel::loadedRowCount
private

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