![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
Settings pages with grouped left navigation and search, without any dialog chrome. More...
#include <settings_view.h>
Public Types | |
| enum | SettingsPage { GeneralPage = 0 , AppearancePage , UserInterfacePage , DeckEditorPage , StoragePage , MessagesPage , SoundPage , ShortcutsPage , NumPages } |
| Page order in the navigation, matching the order pages are added in setupUi(). More... | |
Public Member Functions | |
| SettingsView (QWidget *parent=nullptr) | |
| void | setTab (int index) |
| AbstractSettingsPage * | page (SettingsPage which) const |
Protected Member Functions | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
Private Slots | |
| void | onTabClicked (int index) |
| void | onSearchTextChanged (const QString &text) |
| void | onSearchResultClicked (const QModelIndex &index) |
Private Member Functions | |
| void | setupUi () |
| void | setupNavTree () |
| void | buildSearchIndex () |
| void | switchToTabMode () |
| void | switchToSearchMode () |
| void | navigateToSearchResult (const QModelIndex &index) |
| void | navigateToSection (int pageIndex, QWidget *sectionWidget) |
| void | setActiveTab (int index) |
| void | switchPageContent (int index) |
| void | applySectionFilter (int pageIndex, QWidget *sectionWidget) |
| Shows only the given section of a page, hiding its siblings. | |
| void | selectSectionRow (int pageIndex, QWidget *sectionWidget) |
| Selects the nav row for a section, expanding its page row. | |
| QTreeWidgetItem * | findSectionItem (int pageIndex, QWidget *sectionWidget) const |
| Finds the nav row for a section widget. | |
| void | retranslateUi () |
| void | retranslateNavNames () |
Static Private Member Functions | |
| static void | flashWidget (QWidget *widget) |
| static void | scrollToAndFlash (QWidget *target) |
| static QStringList | translatedPageNames () |
| static QStringList | translatedGroupNames () |
Private Attributes | |
| QLineEdit * | searchEdit |
| Search bar for filtering settings. | |
| QTreeWidget * | navTree |
| Grouped navigation tree for the pages. | |
| QList< QTreeWidgetItem * > | groupItems |
| Group header rows, indexed by group. | |
| QList< QTreeWidgetItem * > | pageItems |
| Page rows, indexed by SettingsPage. | |
| QStackedWidget * | pagesWidget |
| Stacked widget containing settings pages. | |
| QListView * | searchResultsView |
| Search results list view. | |
| QWidget * | pagesContainer |
| Container stacking pages and search results. | |
| QList< AbstractSettingsPage * > | pages |
| All settings page instances. | |
| SettingsSearchModel * | searchModel |
| Model for search results. | |
| SettingsSearchDelegate * | searchDelegate |
| Delegate for search result rendering. | |
| int | currentTabIndex |
| Currently active tab index. | |
| bool | searchActive |
| Whether search mode is active. | |
| QWidget * | isolatedSection = nullptr |
| Isolated section group box, or nullptr for full pages. | |
| bool | pressWasOnCurrentItem = false |
| True when the mouse press started on the already-current item. | |
Settings pages with grouped left navigation and search, without any dialog chrome.
Owns the search bar, the navigation tree, the stacked settings pages and the search results view. The settings dialog only adds its own frame (buttons, titles).
Page order in the navigation, 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 | |
|
explicit |
|
private |
Shows only the given section of a page, hiding its siblings.
A null sectionWidget restores the full page. Unknown widgets fall back to the full page so a stale reference can never leave a blank page.
| pageIndex | SettingsPage to filter |
| sectionWidget | Section's group box, or nullptr to show all sections |
|
private |
|
overrideprotected |
|
private |
Finds the nav row for a section widget.
| pageIndex | SettingsPage owning the section |
| sectionWidget | Section's group box |
|
staticprivate |
|
private |
|
private |
|
privateslot |
|
privateslot |
|
privateslot |
| AbstractSettingsPage * SettingsView::page | ( | SettingsPage | which | ) | const |
|
private |
|
private |
|
staticprivate |
|
private |
Selects the nav row for a section, expanding its page row.
A null or unknown section (a page whose sections are its own group boxes) leaves the current selection untouched, so callers can pass a lookup result directly.
| pageIndex | SettingsPage owning the section |
| sectionWidget | Section's group box, or nullptr for no section |
|
private |
| void SettingsView::setTab | ( | int | index | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
Currently active tab index.
|
private |
Group header rows, indexed by group.
|
private |
Isolated section group box, or nullptr for full pages.
|
private |
Grouped navigation tree for the pages.
|
private |
Page rows, indexed by SettingsPage.
|
private |
All settings page instances.
|
private |
Container stacking pages and search results.
|
private |
Stacked widget containing settings pages.
|
private |
True when the mouse press started on the already-current item.
|
private |
Whether search mode is active.
|
private |
Delegate for search result rendering.
|
private |
Search bar for filtering settings.
|
private |
Model for search results.
|
private |
Search results list view.