Qt Utilities 6.14.4
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Loading...
Searching...
No Matches
qtsettings.h
Go to the documentation of this file.
1#ifndef DIALOGS_QT_UTILITIES_QTSETTINGS_H
2#define DIALOGS_QT_UTILITIES_QTSETTINGS_H
3
4#include "./optionpage.h"
5
6#include <memory>
7
8QT_FORWARD_DECLARE_CLASS(QFontDialog)
9QT_FORWARD_DECLARE_CLASS(QSettings)
10
11namespace QtUtilities {
12
13class OptionCategory;
14struct QtSettingsData;
15
17public:
18explicit QtAppearanceOptionPage(QtSettingsData &settings, QWidget *parentWidget = nullptr);
19
20private:
22QtSettingsData & m_settings;
23QFontDialog *m_fontDialog;
25
27public:
28explicit QtLanguageOptionPage(QtSettingsData &settings, QWidget *parentWidget = nullptr);
29
30private:
32QtSettingsData & m_settings;
34
36public:
37explicit QtEnvOptionPage(QtSettingsData &settings, QWidget *parentWidget = nullptr);
38
39private:
41QtSettingsData & m_settings;
43
44class QT_UTILITIES_EXPORT QtSettings {
45public:
46 QtSettings();
47 ~QtSettings();
48
49 void disableNotices();
50 void setRetranslatable(bool retranslatable);
51 void restore(QSettings &settings);
52 void save(QSettings &settings) const;
53 void apply();
54 void reapplyDefaultIconTheme(bool isPaletteDark);
55 void reevaluatePaletteAndDefaultIconTheme();
56 bool isPaletteDark();
57 bool hasCustomFont() const;
58 bool hasLocaleChanged() const;
59 operator QtSettingsData &() const;
60
61 OptionCategory *category();
62
63private:
64 std::unique_ptr<QtSettingsData> m_d;
65};
66} // namespace QtUtilities
67
68DECLARE_EXTERN_UI_FILE_BASED_OPTION_PAGE(QtAppearanceOptionPage)
71
72#endif // DIALOGS_QT_UTILITIES_QTSETTINGS_H
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.
Definition global.h:14
QtEnvOptionPage(QtSettingsData &settings, QWidget *parentWidget=nullptr)
QtAppearanceOptionPage(QtSettingsData &settings, QWidget *parentWidget=nullptr)
QtLanguageOptionPage(QtSettingsData &settings, QWidget *parentWidget=nullptr)
QT_UTILITIES_EXPORT bool isPaletteDark(const QPalette &palette=QPalette())
Returns whether palette is dark.
#define DECLARE_EXTERN_UI_FILE_BASED_OPTION_PAGE(SomeClass)
Declares external instantiation of class declared with BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE in a c...
Definition optionpage.h:271
#define BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_CTOR(SomeClass)
Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a convenient way.
Definition optionpage.h:215
#define END_DECLARE_OPTION_PAGE
Must be used after BEGIN_DECLARE_OPTION_PAGE and BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE.
Definition optionpage.h:241
#define DECLARE_SETUP_WIDGETS
Declares the method setupWidget() in a convenient way.
Definition optionpage.h:300