summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorMartin Klapetek <mklapetek@kde.org>2013-12-13 16:24:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-21 13:17:14 +0100
commitcf2b0b017b5a8d2c27ae0700e8e7fd5818e5d469 (patch)
tree3bce25cbd605b16926ac1d04323f09a1fd0b0fac /src/widgets/styles
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 <jpnurmi@digia.com>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
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,
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) {