Allow to instantiate built-in option pages individually

Expose conversion from QtSettings to QtSettingsData so one can pass such
an object to the constructor of e.g. QtLanguageOptionPage.
This commit is contained in:
Martchus 2023-06-26 21:22:12 +02:00
parent 3ac8c8e1a4
commit 8d8585d00d
2 changed files with 12 additions and 0 deletions

View File

@ -548,6 +548,17 @@ QWidget *QtEnvOptionPage::setupWidget()
return widget;
}
/*!
* \brief Returns a handle to the internal data.
* \remarks
* This is an opaque data structure. It can be used to construct option pages
* like QtLanguageOptionPage.
*/
QtSettings::operator QtSettingsData &() const
{
return *m_d.get();
}
} // namespace QtUtilities
INSTANTIATE_UI_FILE_BASED_OPTION_PAGE(QtAppearanceOptionPage)

View File

@ -53,6 +53,7 @@ public:
void reevaluatePaletteAndDefaultIconTheme();
bool isPaletteDark();
bool hasCustomFont() const;
operator QtSettingsData&() const;
OptionCategory *category();