summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <[email protected]>2023-12-14 13:44:44 +0100
committerVolker Hilsheimer <[email protected]>2023-12-15 08:37:33 +0000
commit1358bd9db5300f489b95fbf9015da548bdce367a (patch)
tree2f42bb90b414ea23c1b9e26af9db09a3253dd53f
parentaaf79913f769a118c2d8f1c76963dcc8d86ae372 (diff)
QMessageBox: don't use a native dialog if a style sheet is active
With 6.5 we try to use the native message dialog if we can, but we didn't account for the style sheet. This restores pre-6.5 behavior for QMessageBox. Other dialogs will continue to be native, even if a style sheet is in use. While this is inconsistent, the other dialogs are substantially more functional, so switching to the Qt version because of a style sheet being active would be a significant change of behavior. Fixes: QTBUG-120054 Change-Id: I07eae609bc360140e096c5eb7ad004ffa4422123 Reviewed-by: Oliver Eftevaag <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]> (cherry picked from commit 1b71e2d894c2be7052518cdcb96020c9950e2dc7) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit 3158aa546d3a8e0430f079e0d8b2da0f330628d1) (cherry picked from commit 04dda6cae05109ad5a3a681587ec9cd2cc49028a) Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 9f1a92145c3..46a6e871b14 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -2720,7 +2720,8 @@ bool QMessageBoxPrivate::canBeNativeDialog() const
if (nativeDialogInUse)
return true;
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
- || q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ || q->testAttribute(Qt::WA_DontShowOnScreen)
+ || q->testAttribute(Qt::WA_StyleSheet)) {
return false;
}