diff options
authorMartin Klapetek <>2013-12-13 16:24:01 +0100
committerThe Qt Project <>2014-01-21 13:17:14 +0100
commitcf2b0b017b5a8d2c27ae0700e8e7fd5818e5d469 (patch)
parent5f52974860a9fc62ec5e7c56853156fed01b3aed (diff)
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 <>
1 files changed, 5 insertions, 1 deletions
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,
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);
if (sub & SC_SpinBoxUp) {