diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 2 | ||||
-rw-r--r-- | src/widgets/dialogs/qfontdialog.cpp | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 5da41aa0a5..c9f03c5a97 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -2166,6 +2166,8 @@ void QColorDialog::keyPressEvent(QKeyEvent *e) } e->accept(); return; + } else if (d->nativeDialogInUse && d->platformColorDialogHelper()->event(e)) { + return; } QDialog::keyPressEvent(e); } diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp index b989ea7c86..28afd91a09 100644 --- a/src/widgets/dialogs/qfontdialog.cpp +++ b/src/widgets/dialogs/qfontdialog.cpp @@ -983,14 +983,9 @@ void QFontDialog::setVisible(bool visible) Q_D(QFontDialog); if (d->canBeNativeDialog()) d->setNativeDialogVisible(visible); - 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); - } + // 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); QDialog::setVisible(visible); } |