diff options
| author | Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> | 2025-06-17 10:59:25 +0200 |
|---|---|---|
| committer | Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> | 2025-08-01 17:46:03 +0200 |
| commit | f0f45d1bcd4b1f34b7f47fb9f0458c38d93e6da3 (patch) | |
| tree | 7a43e3a817dc584209d299ac9dc9b315f9eae6ae | |
| parent | 24c731eb272bff5b360d62001eab65a5dd28cd50 (diff) | |
Revert resetting the resolve mask of the tooltip palette
Revert resetting the tooltip palette mask (added as part of patch
4cf92d83c3a8966fd1716939829fdbd4642810e9) as it doesn't allow to set the
tooltip palette from the platform theme (for instance, setting high
contrast theme palette for tooltip).
This patch also make the style sheet style to override its palette over
the widget palette when set, otherwise use the widget palette.
Task-number: QTBUG-135964
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I0da0a09993de37691149fdeed6b9be5ff9964107
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
| -rw-r--r-- | src/widgets/kernel/qapplication.cpp | 7 | ||||
| -rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 82ecd355baf..7593218a7f0 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -496,11 +496,8 @@ void QApplicationPrivate::init() void qt_init_tooltip_palette() { #if QT_CONFIG(tooltip) - if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette)) { - QPalette toolTipPal = *toolTipPalette; - toolTipPal.setResolveMask(0); - QToolTip::setPalette(toolTipPal); - } + if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette)) + QToolTip::setPalette(*toolTipPalette); #endif } diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index f4b21d3b70d..87259f8ec9d 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -1423,10 +1423,10 @@ void setDefault(QPalette *palette, QPalette::ColorGroup group, QPalette::ColorRo const QBrush &defaultBrush, const QWidget *widget) { const QPalette &widgetPalette = widget->palette(); - if (widgetPalette.isBrushSet(group, role)) - palette->setBrush(group, role, widgetPalette.brush(group, role)); - else + if (defaultBrush != Qt::NoBrush) palette->setBrush(group, role, defaultBrush); + else + palette->setBrush(group, role, widgetPalette.brush(group, role)); } void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const QWidget *w, bool embedded) |
