Proxy model for filtering and sorting the GamesModel based on user preferences. More...
#include <games_model.h>
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 UserListProxy * | userListProxy |
| 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 |
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.
|
explicit |
Constructs a GamesProxyModel.
| parent | Parent QObject. |
| _userListProxy | Proxy for accessing ignore/buddy lists. |
|
nodiscard |
Returns true if all filter parameters are set to their defaults.
|
nodiscardprotected |
|
nodiscardoverrideprotected |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
nodiscard |
Returns the number of games filtered out by the current filter.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
| void GamesProxyModel::loadFilterParameters | ( | const QMap< int, QString > & | allGameTypes | ) |
Loads filter parameters from persistent settings.
| allGameTypes | Mapping of all game types by room ID. |
| void GamesProxyModel::refresh | ( | ) |
Refreshes the proxy model (re-applies filters).
| void GamesProxyModel::resetFilterParameters | ( | ) |
Resets all filter parameters to default values.
| void GamesProxyModel::saveFilterParameters | ( | const QMap< int, QString > & | allGameTypes | ) |
Saves filter parameters to persistent settings.
| allGameTypes | Mapping of all game types by room ID. |
|
inline |
| 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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Proxy for checking user ignore/buddy lists.