Qt Utilities 6.14.3
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
|
The SettingsDialog class provides a framework for creating settings dialogs with different categories and subcategories. More...
#include <settingsdialog.h>
Public Slots | |
bool | apply () |
Applies all changes. | |
void | reset () |
Resets all changes. | |
Signals | |
void | applied () |
void | resetted () |
void | retranslationRequired () |
Public Member Functions | |
SettingsDialog (QWidget *parent=nullptr) | |
Constructs a settings dialog. | |
~SettingsDialog () override | |
Destroys the settings dialog. | |
bool | isTabBarAlwaysVisible () const |
Returns whether the tab bar is always visible. | |
void | setTabBarAlwaysVisible (bool value) |
Sets whether the tab bar is always visible. | |
OptionCategoryModel * | categoryModel () |
Returns the category model used by the settings dialog to manage the categories. | |
OptionCategory * | category (int categoryIndex) const |
Returns the category for the specified categoryIndex. | |
OptionPage * | page (int categoryIndex, int pageIndex) const |
Returns the page for the specified categoryIndex and the specified pageIndex. | |
void | showCategory (OptionCategory *category) |
Sets the current category to the specified category and updates the relevant widgets to show it. | |
void | translateCategory (OptionCategory *category, const std::function< QString()> &translator) |
Allows to set the categories display name so that it is retranslated as needed. | |
void | setSingleCategory (OptionCategory *singleCategory) |
Enables single-category mode to show only the specified singleCategory. | |
QWidget * | cornerWidget (Qt::Corner corner=Qt::TopRightCorner) const |
Returns the tab-widget's corner widget. | |
void | setCornerWidget (QWidget *widget, Qt::Corner corner=Qt::TopRightCorner) |
Sets the tab-widget's corner widget. | |
void | addHeadingWidget (QWidget *widget) |
Adds a widget next to the heading. | |
void | selectPage (int categoryIndex, int pageIndex) |
Selects the specified page within the specified category. | |
Protected Member Functions | |
bool | event (QEvent *event) override |
void | showEvent (QShowEvent *event) override |
Resets all pages before the dialog is shown by the application. | |
Properties | |
bool | tabBarAlwaysVisible |
The SettingsDialog class provides a framework for creating settings dialogs with different categories and subcategories.
Definition at line 21 of file settingsdialog.h.
|
explicit |
Constructs a settings dialog.
parent | Specifies the parent widget. |
Definition at line 30 of file settingsdialog.cpp.
|
override |
Destroys the settings dialog.
Definition at line 64 of file settingsdialog.cpp.
void QtUtilities::SettingsDialog::addHeadingWidget | ( | QWidget * | widget | ) |
Adds a widget next to the heading.
Definition at line 213 of file settingsdialog.cpp.
|
signal |
|
slot |
Applies all changes.
Calls OptionCategory::applyAllPages() for each category.
Definition at line 307 of file settingsdialog.cpp.
OptionCategory * QtUtilities::SettingsDialog::category | ( | int | categoryIndex | ) | const |
Returns the category for the specified categoryIndex.
The settings dialog keeps ownership over the returned category. If no category exists for the specified index a null pointer is returned.
Definition at line 86 of file settingsdialog.cpp.
|
inline |
Returns the category model used by the settings dialog to manage the categories.
Definition at line 83 of file settingsdialog.h.
QWidget * QtUtilities::SettingsDialog::cornerWidget | ( | Qt::Corner | corner = Qt::TopRightCorner | ) | const |
Returns the tab-widget's corner widget.
Definition at line 197 of file settingsdialog.cpp.
|
overrideprotected |
Definition at line 359 of file settingsdialog.cpp.
|
inline |
Returns whether the tab bar is always visible.
The tab bar is always visible by default.
Definition at line 74 of file settingsdialog.h.
OptionPage * QtUtilities::SettingsDialog::page | ( | int | categoryIndex, |
int | pageIndex ) const |
Returns the page for the specified categoryIndex and the specified pageIndex.
The settings dialog keeps ownership over the returned category. If no page for the specified indices a null pointer is returned.
Definition at line 98 of file settingsdialog.cpp.
|
slot |
Resets all changes.
Calls OptionCategory::resetAllPages() for each category.
Definition at line 351 of file settingsdialog.cpp.
|
signal |
|
signal |
void QtUtilities::SettingsDialog::selectPage | ( | int | categoryIndex, |
int | pageIndex ) |
Selects the specified page within the specified category.
Definition at line 221 of file settingsdialog.cpp.
void QtUtilities::SettingsDialog::setCornerWidget | ( | QWidget * | widget, |
Qt::Corner | corner = Qt::TopRightCorner ) |
Sets the tab-widget's corner widget.
Definition at line 205 of file settingsdialog.cpp.
void QtUtilities::SettingsDialog::setSingleCategory | ( | OptionCategory * | singleCategory | ) |
Enables single-category mode to show only the specified singleCategory.
Definition at line 181 of file settingsdialog.cpp.
void QtUtilities::SettingsDialog::setTabBarAlwaysVisible | ( | bool | value | ) |
Sets whether the tab bar is always visible.
Definition at line 72 of file settingsdialog.cpp.
void QtUtilities::SettingsDialog::showCategory | ( | OptionCategory * | category | ) |
Sets the current category to the specified category and updates the relevant widgets to show it.
Definition at line 141 of file settingsdialog.cpp.
|
overrideprotected |
Resets all pages before the dialog is shown by the application.
Definition at line 111 of file settingsdialog.cpp.
void QtUtilities::SettingsDialog::translateCategory | ( | OptionCategory * | category, |
const std::function< QString()> & | translator ) |
Allows to set the categories display name so that it is retranslated as needed.
Definition at line 165 of file settingsdialog.cpp.
|
readwrite |
Definition at line 23 of file settingsdialog.h.