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>
bb10
Martin Klapetek 2013-12-13 16:24:01 +01:00 committed by The Qt Project
parent 5f52974860
commit cf2b0b017b
1 changed files with 5 additions and 1 deletions

View File

@ -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) {