Qt Utilities  6.4.1
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
QtUtilities::SettingsDialog Class Reference

The SettingsDialog class provides a framework for creating settings dialogs with different categories and subcategories. More...

#include <settingsdialog.h>

Inheritance diagram for QtUtilities::SettingsDialog:
[legend]
Collaboration diagram for QtUtilities::SettingsDialog:
[legend]

Signals

void applied ()
 
void resetted ()
 

Public Member Functions

 SettingsDialog (QWidget *parent=nullptr)
 Constructs a settings dialog. More...
 
 ~SettingsDialog () override
 Destroys the settings dialog. More...
 
bool isTabBarAlwaysVisible () const
 Returns whether the tab bar is always visible. More...
 
void setTabBarAlwaysVisible (bool value)
 Sets whether the tab bar is always visible. More...
 
OptionCategoryModelcategoryModel ()
 Returns the category model used by the settings dialog to manage the categories. More...
 
OptionCategorycategory (int categoryIndex) const
 Returns the category for the specified categoryIndex. More...
 
OptionPagepage (int categoryIndex, int pageIndex) const
 Returns the page for the specified categoryIndex and the specified pageIndex. More...
 
void showCategory (OptionCategory *category)
 Sets the current category to the specified category and updates the relevant widgets to show it. More...
 
void setSingleCategory (OptionCategory *singleCategory)
 Enables single-category mode to show only the specified singleCategory. More...
 

Protected Member Functions

void showEvent (QShowEvent *event) override
 Resets all pages before the dialog is shown by the application. More...
 

Properties

bool tabBarAlwaysVisible
 

Detailed Description

The SettingsDialog class provides a framework for creating settings dialogs with different categories and subcategories.

Definition at line 21 of file settingsdialog.h.

Constructor & Destructor Documentation

◆ SettingsDialog()

QtUtilities::SettingsDialog::SettingsDialog ( QWidget *  parent = nullptr)
explicit

Constructs a settings dialog.

Parameters
parentSpecifies the parent widget.

Definition at line 30 of file settingsdialog.cpp.

◆ ~SettingsDialog()

QtUtilities::SettingsDialog::~SettingsDialog ( )
override

Destroys the settings dialog.

Definition at line 64 of file settingsdialog.cpp.

Member Function Documentation

◆ applied

void QtUtilities::SettingsDialog::applied ( )
signal

◆ category()

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.

◆ categoryModel()

OptionCategoryModel * QtUtilities::SettingsDialog::categoryModel ( )
inline

Returns the category model used by the settings dialog to manage the categories.

Definition at line 74 of file settingsdialog.h.

◆ isTabBarAlwaysVisible()

bool QtUtilities::SettingsDialog::isTabBarAlwaysVisible ( ) const
inline

Returns whether the tab bar is always visible.

The tab bar is always visible by default.

See also
SettingsDialog::setTabBarAlwaysVisible()

Definition at line 65 of file settingsdialog.h.

◆ page()

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.

◆ resetted

void QtUtilities::SettingsDialog::resetted ( )
signal

◆ setSingleCategory()

void QtUtilities::SettingsDialog::setSingleCategory ( OptionCategory singleCategory)

Enables single-category mode to show only the specified singleCategory.

Remarks
  • In single-category mode category selection, filter and heading are hidden.
  • The single-category mode can be disabled again by setting singleCategory to nullptr.

Definition at line 167 of file settingsdialog.cpp.

◆ setTabBarAlwaysVisible()

void QtUtilities::SettingsDialog::setTabBarAlwaysVisible ( bool  value)

Sets whether the tab bar is always visible.

See also
SettingsDialog::isTabBarAlwaysVisible()

Definition at line 72 of file settingsdialog.cpp.

◆ showCategory()

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.

◆ showEvent()

void QtUtilities::SettingsDialog::showEvent ( QShowEvent *  event)
overrideprotected

Resets all pages before the dialog is shown by the application.

Definition at line 111 of file settingsdialog.cpp.

Property Documentation

◆ tabBarAlwaysVisible

bool QtUtilities::SettingsDialog::tabBarAlwaysVisible
readwrite

Definition at line 74 of file settingsdialog.h.


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