QColorDialog/QFontDialog: Fix setOption().

Call setOptions() such that the option takes effect.

Task-number: QTBUG-28817

Change-Id: Ibef834efc988d3ba49e88ea88ef475b1fd7fd98f
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This commit is contained in:
Friedemann Kleint 2013-02-18 11:27:24 +01:00 committed by The Qt Project
parent 8afd7b4675
commit 4b42c91821
2 changed files with 6 additions and 4 deletions

View File

@ -1735,8 +1735,9 @@ QColor QColorDialog::selectedColor() const
*/ */
void QColorDialog::setOption(ColorDialogOption option, bool on) void QColorDialog::setOption(ColorDialogOption option, bool on)
{ {
Q_D(QColorDialog); const QColorDialog::ColorDialogOptions previousOptions = options();
d->options->setOption(static_cast<QColorDialogOptions::ColorDialogOption>(option), on); if (!(previousOptions & option) != !on)
setOptions(previousOptions ^ option);
} }
/*! /*!

View File

@ -853,8 +853,9 @@ QFont QFontDialog::selectedFont() const
*/ */
void QFontDialog::setOption(FontDialogOption option, bool on) void QFontDialog::setOption(FontDialogOption option, bool on)
{ {
Q_D(QFontDialog); const QFontDialog::FontDialogOptions previousOptions = options();
d->options->setOption(static_cast<QFontDialogOptions::FontDialogOption>(option), on); if (!(previousOptions & option) != !on)
setOptions(previousOptions ^ option);
} }
/*! /*!