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

Proxy model for filtering and sorting the GamesModel based on user preferences. More...

#include <games_model.h>

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

Public Member Functions

 GamesProxyModel (QObject *parent=nullptr, const UserListProxy *_userListProxy=nullptr)
 Constructs a GamesProxyModel.
bool getHideBuddiesOnlyGames () const
bool getHideIgnoredUserGames () const
bool getHideFullGames () const
bool getHideGamesThatStarted () const
bool getHidePasswordProtectedGames () const
bool getHideNotBuddyCreatedGames () const
bool getHideOpenDecklistGames () const
QString getGameNameFilter () const
QStringList getCreatorNameFilters () const
QSet< int > getGameTypeFilter () const
int getMaxPlayersFilterMin () const
int getMaxPlayersFilterMax () const
const QTime & getMaxGameAge () const
bool getShowOnlyIfSpectatorsCanWatch () const
bool getShowSpectatorPasswordProtected () const
bool getShowOnlyIfSpectatorsCanChat () const
bool getShowOnlyIfSpectatorsCanSeeHands () const
void setGameFilters (bool _hideBuddiesOnlyGames, bool _hideIgnoredUserGames, bool _hideFullGames, bool _hideGamesThatStarted, bool _hidePasswordProtectedGames, bool _hideNotBuddyCreatedGames, bool _hideOpenDecklistGames, const QString &_gameNameFilter, const QStringList &_creatorNameFilter, const QSet< int > &_gameTypeFilter, int _maxPlayersFilterMin, int _maxPlayersFilterMax, const QTime &_maxGameAge, bool _showOnlyIfSpectatorsCanWatch, bool _showSpectatorPasswordProtected, bool _showOnlyIfSpectatorsCanChat, bool _showOnlyIfSpectatorsCanSeeHands)
 Sets all game filters at once.
void setHideBuddiesOnlyGames (bool value)
void setHideIgnoredUserGames (bool value)
void setHideFullGames (bool value)
void setHideGamesThatStarted (bool value)
void setHidePasswordProtectedGames (bool value)
void setHideNotBuddyCreatedGames (bool value)
void setHideOpenDecklistGames (bool value)
void setGameNameFilter (const QString &value)
void setCreatorNameFilters (const QStringList &values)
void setGameTypeFilter (const QSet< int > &value)
void setMaxPlayersFilterMin (int value)
void setMaxPlayersFilterMax (int value)
void setMaxGameAge (const QTime &value)
void setShowOnlyIfSpectatorsCanWatch (bool value)
void setShowSpectatorPasswordProtected (bool value)
void setShowOnlyIfSpectatorsCanChat (bool value)
void setShowOnlyIfSpectatorsCanSeeHands (bool value)
int getNumFilteredGames () const
 Returns the number of games filtered out by the current filter.
void resetFilterParameters ()
 Resets all filter parameters to default values.
bool areFilterParametersSetToDefaults () const
 Returns true if all filter parameters are set to their defaults.
void loadFilterParameters (const QMap< int, QString > &allGameTypes)
 Loads filter parameters from persistent settings.
void saveFilterParameters (const QMap< int, QString > &allGameTypes)
 Saves filter parameters to persistent settings.
void refresh ()
 Refreshes the proxy model (re-applies filters).

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
bool filterAcceptsRow (int sourceRow) const

Private Attributes

const UserListProxyuserListProxy
bool hideBuddiesOnlyGames
bool hideIgnoredUserGames
bool hideFullGames
bool hideGamesThatStarted
bool hidePasswordProtectedGames
bool hideNotBuddyCreatedGames
bool hideOpenDecklistGames
QString gameNameFilter
QStringList creatorNameFilters
QSet< int > gameTypeFilter
quint32 maxPlayersFilterMin
quint32 maxPlayersFilterMax
QTime maxGameAge
bool showOnlyIfSpectatorsCanWatch
bool showSpectatorPasswordProtected
bool showOnlyIfSpectatorsCanChat
bool showOnlyIfSpectatorsCanSeeHands

Detailed Description

Proxy model for filtering and sorting the GamesModel based on user preferences.

Supports filtering games based on buddies-only, ignored users, password protection, game types, creator, age, player count, and spectator permissions.

Constructor & Destructor Documentation

◆ GamesProxyModel()

GamesProxyModel::GamesProxyModel ( QObject * parent = nullptr,
const UserListProxy * _userListProxy = nullptr )
explicit

Constructs a GamesProxyModel.

Parameters
parentParent QObject.
_userListProxyProxy for accessing ignore/buddy lists.
Here is the call graph for this function:

Member Function Documentation

◆ areFilterParametersSetToDefaults()

bool GamesProxyModel::areFilterParametersSetToDefaults ( ) const
nodiscard

Returns true if all filter parameters are set to their defaults.

◆ filterAcceptsRow() [1/2]

bool GamesProxyModel::filterAcceptsRow ( int sourceRow) const
nodiscardprotected

◆ filterAcceptsRow() [2/2]

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

◆ getCreatorNameFilters()

QStringList GamesProxyModel::getCreatorNameFilters ( ) const
inlinenodiscard

◆ getGameNameFilter()

QString GamesProxyModel::getGameNameFilter ( ) const
inlinenodiscard

◆ getGameTypeFilter()

QSet< int > GamesProxyModel::getGameTypeFilter ( ) const
inlinenodiscard

◆ getHideBuddiesOnlyGames()

bool GamesProxyModel::getHideBuddiesOnlyGames ( ) const
inlinenodiscard

◆ getHideFullGames()

bool GamesProxyModel::getHideFullGames ( ) const
inlinenodiscard

◆ getHideGamesThatStarted()

bool GamesProxyModel::getHideGamesThatStarted ( ) const
inlinenodiscard

◆ getHideIgnoredUserGames()

bool GamesProxyModel::getHideIgnoredUserGames ( ) const
inlinenodiscard

◆ getHideNotBuddyCreatedGames()

bool GamesProxyModel::getHideNotBuddyCreatedGames ( ) const
inlinenodiscard

◆ getHideOpenDecklistGames()

bool GamesProxyModel::getHideOpenDecklistGames ( ) const
inlinenodiscard

◆ getHidePasswordProtectedGames()

bool GamesProxyModel::getHidePasswordProtectedGames ( ) const
inlinenodiscard

◆ getMaxGameAge()

const QTime & GamesProxyModel::getMaxGameAge ( ) const
inlinenodiscard

◆ getMaxPlayersFilterMax()

int GamesProxyModel::getMaxPlayersFilterMax ( ) const
inlinenodiscard

◆ getMaxPlayersFilterMin()

int GamesProxyModel::getMaxPlayersFilterMin ( ) const
inlinenodiscard

◆ getNumFilteredGames()

int GamesProxyModel::getNumFilteredGames ( ) const
nodiscard

Returns the number of games filtered out by the current filter.

Here is the call graph for this function:

◆ getShowOnlyIfSpectatorsCanChat()

bool GamesProxyModel::getShowOnlyIfSpectatorsCanChat ( ) const
inlinenodiscard

◆ getShowOnlyIfSpectatorsCanSeeHands()

bool GamesProxyModel::getShowOnlyIfSpectatorsCanSeeHands ( ) const
inlinenodiscard

◆ getShowOnlyIfSpectatorsCanWatch()

bool GamesProxyModel::getShowOnlyIfSpectatorsCanWatch ( ) const
inlinenodiscard

◆ getShowSpectatorPasswordProtected()

bool GamesProxyModel::getShowSpectatorPasswordProtected ( ) const
inlinenodiscard

◆ loadFilterParameters()

void GamesProxyModel::loadFilterParameters ( const QMap< int, QString > & allGameTypes)

Loads filter parameters from persistent settings.

Parameters
allGameTypesMapping of all game types by room ID.
Here is the call graph for this function:

◆ refresh()

void GamesProxyModel::refresh ( )

Refreshes the proxy model (re-applies filters).

Here is the caller graph for this function:

◆ resetFilterParameters()

void GamesProxyModel::resetFilterParameters ( )

Resets all filter parameters to default values.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveFilterParameters()

void GamesProxyModel::saveFilterParameters ( const QMap< int, QString > & allGameTypes)

Saves filter parameters to persistent settings.

Parameters
allGameTypesMapping of all game types by room ID.
Here is the call graph for this function:

◆ setCreatorNameFilters()

void GamesProxyModel::setCreatorNameFilters ( const QStringList & values)
inline
Here is the call graph for this function:

◆ setGameFilters()

void GamesProxyModel::setGameFilters ( bool _hideBuddiesOnlyGames,
bool _hideIgnoredUserGames,
bool _hideFullGames,
bool _hideGamesThatStarted,
bool _hidePasswordProtectedGames,
bool _hideNotBuddyCreatedGames,
bool _hideOpenDecklistGames,
const QString & _gameNameFilter,
const QStringList & _creatorNameFilter,
const QSet< int > & _gameTypeFilter,
int _maxPlayersFilterMin,
int _maxPlayersFilterMax,
const QTime & _maxGameAge,
bool _showOnlyIfSpectatorsCanWatch,
bool _showSpectatorPasswordProtected,
bool _showOnlyIfSpectatorsCanChat,
bool _showOnlyIfSpectatorsCanSeeHands )

Sets all game filters at once.

Here is the caller graph for this function:

◆ setGameNameFilter()

void GamesProxyModel::setGameNameFilter ( const QString & value)
inline
Here is the call graph for this function:

◆ setGameTypeFilter()

void GamesProxyModel::setGameTypeFilter ( const QSet< int > & value)
inline
Here is the call graph for this function:

◆ setHideBuddiesOnlyGames()

void GamesProxyModel::setHideBuddiesOnlyGames ( bool value)
inline
Here is the call graph for this function:

◆ setHideFullGames()

void GamesProxyModel::setHideFullGames ( bool value)
inline
Here is the call graph for this function:

◆ setHideGamesThatStarted()

void GamesProxyModel::setHideGamesThatStarted ( bool value)
inline
Here is the call graph for this function:

◆ setHideIgnoredUserGames()

void GamesProxyModel::setHideIgnoredUserGames ( bool value)
inline
Here is the call graph for this function:

◆ setHideNotBuddyCreatedGames()

void GamesProxyModel::setHideNotBuddyCreatedGames ( bool value)
inline
Here is the call graph for this function:

◆ setHideOpenDecklistGames()

void GamesProxyModel::setHideOpenDecklistGames ( bool value)
inline
Here is the call graph for this function:

◆ setHidePasswordProtectedGames()

void GamesProxyModel::setHidePasswordProtectedGames ( bool value)
inline
Here is the call graph for this function:

◆ setMaxGameAge()

void GamesProxyModel::setMaxGameAge ( const QTime & value)
inline
Here is the call graph for this function:

◆ setMaxPlayersFilterMax()

void GamesProxyModel::setMaxPlayersFilterMax ( int value)
inline
Here is the call graph for this function:

◆ setMaxPlayersFilterMin()

void GamesProxyModel::setMaxPlayersFilterMin ( int value)
inline
Here is the call graph for this function:

◆ setShowOnlyIfSpectatorsCanChat()

void GamesProxyModel::setShowOnlyIfSpectatorsCanChat ( bool value)
inline
Here is the call graph for this function:

◆ setShowOnlyIfSpectatorsCanSeeHands()

void GamesProxyModel::setShowOnlyIfSpectatorsCanSeeHands ( bool value)
inline
Here is the call graph for this function:

◆ setShowOnlyIfSpectatorsCanWatch()

void GamesProxyModel::setShowOnlyIfSpectatorsCanWatch ( bool value)
inline
Here is the call graph for this function:

◆ setShowSpectatorPasswordProtected()

void GamesProxyModel::setShowSpectatorPasswordProtected ( bool value)
inline
Here is the call graph for this function:

Member Data Documentation

◆ creatorNameFilters

QStringList GamesProxyModel::creatorNameFilters
private

◆ gameNameFilter

QString GamesProxyModel::gameNameFilter
private

◆ gameTypeFilter

QSet<int> GamesProxyModel::gameTypeFilter
private

◆ hideBuddiesOnlyGames

bool GamesProxyModel::hideBuddiesOnlyGames
private

◆ hideFullGames

bool GamesProxyModel::hideFullGames
private

◆ hideGamesThatStarted

bool GamesProxyModel::hideGamesThatStarted
private

◆ hideIgnoredUserGames

bool GamesProxyModel::hideIgnoredUserGames
private

◆ hideNotBuddyCreatedGames

bool GamesProxyModel::hideNotBuddyCreatedGames
private

◆ hideOpenDecklistGames

bool GamesProxyModel::hideOpenDecklistGames
private

◆ hidePasswordProtectedGames

bool GamesProxyModel::hidePasswordProtectedGames
private

◆ maxGameAge

QTime GamesProxyModel::maxGameAge
private

◆ maxPlayersFilterMax

quint32 GamesProxyModel::maxPlayersFilterMax
private

◆ maxPlayersFilterMin

quint32 GamesProxyModel::maxPlayersFilterMin
private

◆ showOnlyIfSpectatorsCanChat

bool GamesProxyModel::showOnlyIfSpectatorsCanChat
private

◆ showOnlyIfSpectatorsCanSeeHands

bool GamesProxyModel::showOnlyIfSpectatorsCanSeeHands
private

◆ showOnlyIfSpectatorsCanWatch

bool GamesProxyModel::showOnlyIfSpectatorsCanWatch
private

◆ showSpectatorPasswordProtected

bool GamesProxyModel::showSpectatorPasswordProtected
private

◆ userListProxy

const UserListProxy* GamesProxyModel::userListProxy
private

Proxy for checking user ignore/buddy lists.


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