Fix QColorDialog::DontUseNativeDialog usage

Task-number: QTBUG-29387
Change-Id: I97b3267981a0dcfdc95469cd0725b52ac4845346
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
J-P Nurmi 2013-01-30 10:28:27 +01:00 committed by The Qt Project
parent ffea8e98f7
commit 2f854e5090

View File

@ -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