From cf2b0b017b5a8d2c27ae0700e8e7fd5818e5d469 Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Fri, 13 Dec 2013 16:24:01 +0100 Subject: Don't skip content drawing for QtQuickControls SpinBox If XPThemeData::noContent is set to true, the SpinBox from QtQuickControls renders with transparent background, which is being workarounded by simply adding white rectangle inside the QQC SpinBox, which in turn breaks other themes. This works in normal widget's QStyle because the spinbox there is drawn with a frameless QLineEdit, which fills the background. Setting XPThemeData::noContent to false for QtQuick items only makes the QQC SpinBox render correctly with Windows Vista style. Change-Id: I3229a2582dd1cad95c77e0961aaef502a8c6159a Reviewed-by: J-P Nurmi --- src/widgets/styles/qwindowsvistastyle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 2f36944b5e..af379b756e 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1879,7 +1879,11 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle XPThemeData ftheme(widget, painter, QWindowsXPStylePrivate::EditTheme, partId, stateId, r); - ftheme.noContent = true; + // The spinbox in Windows QStyle is drawn with frameless QLineEdit inside it + // That however breaks with QtQuickControls where this results in transparent + // spinbox background, so if there's no "widget" passed (QtQuickControls case), + // let ftheme.noContent be false, which fixes the spinbox rendering in QQC + ftheme.noContent = (widget != NULL); d->drawBackground(ftheme); } if (sub & SC_SpinBoxUp) { -- cgit v1.2.3