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

Main application settings dialog with tabbed navigation and search. More...

#include <dlg_settings.h>

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

Public Types

enum  SettingsPage {
  GeneralPage = 0 , AppearancePage , UserInterfacePage , DeckEditorPage ,
  StoragePage , MessagesPage , SoundPage , ShortcutsPage ,
  NumPages
}
 Page order in the tab bar, matching the order pages are added in setupUi(). More...

Public Member Functions

 DlgSettings (QWidget *parent=nullptr)
void setTab (int index)

Protected Member Functions

void closeEvent (QCloseEvent *event) override
bool eventFilter (QObject *watched, QEvent *event) override

Private Slots

void onTabClicked (int index)
void onSearchTextChanged (const QString &text)
void onSearchResultClicked (const QModelIndex &index)
void updateLanguage ()

Private Member Functions

void setupUi ()
void setupTabBar ()
void buildSearchIndex ()
void switchToTabMode ()
void switchToSearchMode ()
void navigateToSearchResult (const QModelIndex &index)
void setActiveTab (int index)
void retranslateUi ()
void retranslateTabNames ()

Static Private Member Functions

static void flashWidget (QWidget *widget)
static QStringList translatedPageNames ()

Private Attributes

QLineEdit * searchEdit
 Search bar for filtering settings.
QWidget * tabBarWidget
 Container widget for the tab buttons.
QList< QToolButton * > tabButtons
 Navigation tab buttons.
QStackedWidget * pagesWidget
 Stacked widget containing settings pages.
QListView * searchResultsView
 Search results list view.
QWidget * pagesContainer
 Container stacking pages and search results.
QPushButton * okButton
 Button to close the dialog.
QList< AbstractSettingsPage * > pages
 All settings page instances.
SettingsSearchModelsearchModel
 Model for search results.
SettingsSearchDelegatesearchDelegate
 Delegate for search result rendering.
int currentTabIndex
 Currently active tab index.
bool searchActive
 Whether search mode is active.

Detailed Description

Main application settings dialog with tabbed navigation and search.

Provides a modern settings interface organized into tabbed pages. Users can either navigate by clicking tabs or search for specific settings using the built-in search bar. Search results are filtered and ranked by relevance.

Member Enumeration Documentation

◆ SettingsPage

Page order in the tab bar, matching the order pages are added in setupUi().

Use these values instead of raw indices so reordering pages never silently breaks external callers like tab_room.cpp.

Enumerator
GeneralPage 
AppearancePage 
UserInterfacePage 
DeckEditorPage 
StoragePage 
MessagesPage 
SoundPage 
ShortcutsPage 
NumPages 

Constructor & Destructor Documentation

◆ DlgSettings()

DlgSettings::DlgSettings ( QWidget * parent = nullptr)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ buildSearchIndex()

void DlgSettings::buildSearchIndex ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeEvent()

void DlgSettings::closeEvent ( QCloseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ eventFilter()

bool DlgSettings::eventFilter ( QObject * watched,
QEvent * event )
overrideprotected
Here is the call graph for this function:

◆ flashWidget()

void DlgSettings::flashWidget ( QWidget * widget)
staticprivate
Here is the caller graph for this function:

◆ navigateToSearchResult()

void DlgSettings::navigateToSearchResult ( const QModelIndex & index)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onSearchResultClicked

void DlgSettings::onSearchResultClicked ( const QModelIndex & index)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onSearchTextChanged

void DlgSettings::onSearchTextChanged ( const QString & text)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onTabClicked

void DlgSettings::onTabClicked ( int index)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateTabNames()

void DlgSettings::retranslateTabNames ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateUi()

void DlgSettings::retranslateUi ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setActiveTab()

void DlgSettings::setActiveTab ( int index)
private
Here is the caller graph for this function:

◆ setTab()

void DlgSettings::setTab ( int index)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupTabBar()

void DlgSettings::setupTabBar ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupUi()

void DlgSettings::setupUi ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ switchToSearchMode()

void DlgSettings::switchToSearchMode ( )
private
Here is the caller graph for this function:

◆ switchToTabMode()

void DlgSettings::switchToTabMode ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ translatedPageNames()

QStringList DlgSettings::translatedPageNames ( )
staticprivate
Here is the caller graph for this function:

◆ updateLanguage

void DlgSettings::updateLanguage ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ currentTabIndex

int DlgSettings::currentTabIndex
private

Currently active tab index.

◆ okButton

QPushButton* DlgSettings::okButton
private

Button to close the dialog.

◆ pages

QList<AbstractSettingsPage *> DlgSettings::pages
private

All settings page instances.

◆ pagesContainer

QWidget* DlgSettings::pagesContainer
private

Container stacking pages and search results.

◆ pagesWidget

QStackedWidget* DlgSettings::pagesWidget
private

Stacked widget containing settings pages.

◆ searchActive

bool DlgSettings::searchActive
private

Whether search mode is active.

◆ searchDelegate

SettingsSearchDelegate* DlgSettings::searchDelegate
private

Delegate for search result rendering.

◆ searchEdit

QLineEdit* DlgSettings::searchEdit
private

Search bar for filtering settings.

◆ searchModel

SettingsSearchModel* DlgSettings::searchModel
private

Model for search results.

◆ searchResultsView

QListView* DlgSettings::searchResultsView
private

Search results list view.

◆ tabBarWidget

QWidget* DlgSettings::tabBarWidget
private

Container widget for the tab buttons.

◆ tabButtons

QList<QToolButton *> DlgSettings::tabButtons
private

Navigation tab buttons.


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