diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 5adb4ba6dae..7ba8f60f713 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1856,15 +1856,12 @@ void QColorDialog::setVisible(bool visible) } #else - if (!(options() & DontUseNativeDialog)) + if (!(options() & DontUseNativeDialog) && d->nativeDialogInUse) { 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); } else { - d->nativeDialogInUse = false; setAttribute(Qt::WA_DontShowOnScreen, false); } #endif