summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp5
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 5adb4ba6da..af43ecc8df 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1735,8 +1735,9 @@ QColor QColorDialog::selectedColor() const
*/
void QColorDialog::setOption(ColorDialogOption option, bool on)
{
- Q_D(QColorDialog);
- d->options->setOption(static_cast<QColorDialogOptions::ColorDialogOption>(option), on);
+ const QColorDialog::ColorDialogOptions previousOptions = options();
+ if (!(previousOptions & option) != !on)
+ setOptions(previousOptions ^ option);
}
/*!
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 79aab3280f..4036dc80ab 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -853,8 +853,9 @@ QFont QFontDialog::selectedFont() const
*/
void QFontDialog::setOption(FontDialogOption option, bool on)
{
- Q_D(QFontDialog);
- d->options->setOption(static_cast<QFontDialogOptions::FontDialogOption>(option), on);
+ const QFontDialog::FontDialogOptions previousOptions = options();
+ if (!(previousOptions & option) != !on)
+ setOptions(previousOptions ^ option);
}
/*!