Improve settings dialog

This commit is contained in:
Martchus 2016-08-27 15:18:44 +02:00
parent 924c3b9f61
commit 72296a2768
4 changed files with 23 additions and 3 deletions

View File

@ -142,6 +142,7 @@ inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
* \remarks Must be closed with END_DECLARE_OPTION_PAGE.
*/
#define BEGIN_DECLARE_OPTION_PAGE(SomeClass) \
typedef ::Dialogs::OptionPage SomeClass ## Base; \
class LIB_EXPORT SomeClass : public ::Dialogs::OptionPage \
{ \
public: \
@ -245,6 +246,15 @@ inline UiClass *UiFileBasedOptionPage<UiClass>::ui()
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(SomeClass) \
END_DECLARE_OPTION_PAGE
/*!
* \brief Declares a class inheriting from Dialogs::OptionPage in a convenient way.
* \remarks Doesn't allow to declare additional class members.
*/
#define DECLARE_OPTION_PAGE(SomeClass) \
BEGIN_DECLARE_OPTION_PAGE(SomeClass) \
DECLARE_SETUP_WIDGETS \
END_DECLARE_OPTION_PAGE
/*!
* \brief Declares a class inheriting from Dialogs::UiFileBasedOptionPage in a convenient way.
* \remarks Doesn't allow to declare additional class members.

View File

@ -242,11 +242,15 @@
</font>
</property>
<property name="text">
<string>These settings take effect after restarting the application.</string>
<string>These settings take effect after restarting the application.
These settings might be overwritten by your Qt 5 platfrom integration plugin and hence have no effect.</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>

View File

@ -94,7 +94,7 @@ bool QtSettings::hasCustomFont() const
void QtSettings::restore(QSettings &settings)
{
settings.beginGroup(QStringLiteral("qt"));
m_d->font = settings.value(QStringLiteral("font"), m_d->font).value<QFont>();
m_d->font.fromString(settings.value(QStringLiteral("font")).toString());
m_d->customFont = settings.value(QStringLiteral("customfont"), false).toBool();
m_d->palette = settings.value(QStringLiteral("palette")).value<QPalette>();
m_d->customPalette = settings.value(QStringLiteral("custompalette"), false).toBool();
@ -118,7 +118,7 @@ void QtSettings::restore(QSettings &settings)
void QtSettings::save(QSettings &settings) const
{
settings.beginGroup(QStringLiteral("qt"));
settings.setValue(QStringLiteral("font"), m_d->font);
settings.setValue(QStringLiteral("font"), m_d->font.toString());
settings.setValue(QStringLiteral("customfont"), m_d->customFont);
settings.setValue(QStringLiteral("palette"), m_d->palette);
settings.setValue(QStringLiteral("custompalette"), m_d->customPalette);

View File

@ -32,6 +32,9 @@
<item>
<widget class="QWidget" name="mainWidget" native="true">
<layout class="QGridLayout" name="gridLayout">
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="1">
<widget class="QLabel" name="headingLabel">
<property name="sizePolicy">
@ -105,6 +108,9 @@
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>