QColorDialog: Account for native dialog helper not being able to show
The color dialog implementation lazily initializes the widget hierarchy, so that they are not created if we're using a native dialog. But unlike QFileDialog, which does the same, QColorDialog failed to handle the case where the native helper could not show a native dialog. We now correctly lazy initialize the widget hierarchy if the native show fails. The WA_DontShowOnScreen state management has been left out, as it needs some general refactoring. This patch doesn't fix, or regress, any logic related to WA_DontShowOnScreen. Task-number: QTBUG-108153 Change-Id: Icbd506617a2fe302bb61aab977e7c8ea4bd64878 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
c1088d493e
commit
b2de858a8c
@ -2117,10 +2117,13 @@ void QColorDialog::setVisible(bool visible)
|
|||||||
d->selectedQColor = QColor();
|
d->selectedQColor = QColor();
|
||||||
|
|
||||||
if (d->nativeDialogInUse) {
|
if (d->nativeDialogInUse) {
|
||||||
d->setNativeDialogVisible(visible);
|
if (d->setNativeDialogVisible(visible)) {
|
||||||
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
|
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
|
||||||
// updates the state correctly, but skips showing the non-native version:
|
// updates the state correctly, but skips showing the non-native version:
|
||||||
setAttribute(Qt::WA_DontShowOnScreen);
|
setAttribute(Qt::WA_DontShowOnScreen);
|
||||||
|
} else {
|
||||||
|
d->initWidgets();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setAttribute(Qt::WA_DontShowOnScreen, false);
|
setAttribute(Qt::WA_DontShowOnScreen, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user