Qt Utilities 6.18.1
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
|
#include <qtsettings.h>
Public Member Functions | |
QtSettings () | |
Creates a new settings object. | |
~QtSettings () | |
Destroys the settings object. | |
void | restore (QSettings &settings) |
Restores the settings from the specified QSettings object. | |
void | save (QSettings &settings) const |
Saves the settings to the specified QSettings object. | |
void | apply () |
Applies the current configuration. | |
void | reapplyDefaultIconTheme (bool isPaletteDark) |
Re-applies default icon theme assuming the palette is dark or not depending on isPaletteDark. | |
void | reevaluatePaletteAndDefaultIconTheme () |
Re-evaluates whether the palette is dark and re-applies default icon theme. | |
bool | isPaletteDark () |
Returns whether the palette is dark. | |
bool | hasCustomFont () const |
Returns whether a custom font is set. | |
bool | hasLocaleChanged () const |
Returns whether the last apply() call has changed the default locale. | |
operator QtSettingsData & () const | |
Returns a handle to the internal data. | |
OptionCategory * | category () |
Definition at line 52 of file qtsettings.h.
QtUtilities::QtSettings::QtSettings | ( | ) |
Creates a new settings object.
Definition at line 117 of file qtsettings.cpp.
QtUtilities::QtSettings::~QtSettings | ( | ) |
Destroys the settings object.
Definition at line 127 of file qtsettings.cpp.
void QtUtilities::QtSettings::apply | ( | ) |
Applies the current configuration.
This function may be called multiple times. This supports restoring default settings (e.g. if use of a custom icon theme has been disabled again after it was enabled the default icon theme will be configured again).
Definition at line 276 of file qtsettings.cpp.
OptionCategory * QtUtilities::QtSettings::category | ( | ) |
bool QtUtilities::QtSettings::hasCustomFont | ( | ) | const |
Returns whether a custom font is set.
Definition at line 165 of file qtsettings.cpp.
bool QtUtilities::QtSettings::hasLocaleChanged | ( | ) | const |
Returns whether the last apply() call has changed the default locale.
Definition at line 462 of file qtsettings.cpp.
bool QtUtilities::QtSettings::isPaletteDark | ( | ) |
Returns whether the palette is dark.
Definition at line 454 of file qtsettings.cpp.
QtUtilities::QtSettings::operator QtSettingsData & | ( | ) | const |
Returns a handle to the internal data.
Definition at line 669 of file qtsettings.cpp.
void QtUtilities::QtSettings::reapplyDefaultIconTheme | ( | bool | isPaletteDark | ) |
Re-applies default icon theme assuming the palette is dark or not depending on isPaletteDark.
Re-assigns the appropriate default icon theme depending on the current palette. Call this function after the darkmode setting has changed without the current palette reflecting that but you want the darkmode setting take precedence over the palette (e.g. when using Qt Quick Material style under Android). If your application makes actually use of the palette and you want the palette take precedence than call reevaluatePaletteAndDefaultIconTheme() instead.
Note that QtSettings::isPaletteDark() will return isPaletteDark after calling this function (even though the current palette is not actually reflecting that).
Definition at line 422 of file qtsettings.cpp.
void QtUtilities::QtSettings::reevaluatePaletteAndDefaultIconTheme | ( | ) |
Re-evaluates whether the palette is dark and re-applies default icon theme.
Re-assigns the appropriate default icon theme depending on the current palette. Call this function after the palette has changed.
Definition at line 443 of file qtsettings.cpp.
void QtUtilities::QtSettings::restore | ( | QSettings & | settings | ) |
Restores the settings from the specified QSettings object.
Definition at line 176 of file qtsettings.cpp.
void QtUtilities::QtSettings::save | ( | QSettings & | settings | ) | const |
Saves the settings to the specified QSettings object.
Definition at line 205 of file qtsettings.cpp.