summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfontdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qfontdialog.cpp')
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 28afd91a09..b989ea7c86 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -983,9 +983,14 @@ void QFontDialog::setVisible(bool visible)
Q_D(QFontDialog);
if (d->canBeNativeDialog())
d->setNativeDialogVisible(visible);
- // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
- // updates the state correctly, but skips showing the non-native version:
- setAttribute(Qt::WA_DontShowOnScreen, d->nativeDialogInUse);
+ if (d->nativeDialogInUse) {
+ // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
+ // updates the state correctly, but skips showing the non-native version:
+ setAttribute(Qt::WA_DontShowOnScreen, true);
+ } else {
+ d->nativeDialogInUse = false;
+ setAttribute(Qt::WA_DontShowOnScreen, false);
+ }
QDialog::setVisible(visible);
}