Fix widget borders when using global stylesheetstyle

Recent fixes to stylesheetstyle caused not calling fixupBorder()
when globalStyleSheetStyle is used.

Task-number: QTBUG-27651
Change-Id: I73263c951e2db7d574e81da3f60a1b79f3852716
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Miikka Heikkinen 2012-10-23 11:50:13 +03:00 committed by The Qt Project
parent b5d55f3a35
commit 82cb34b05f

View File

@ -997,16 +997,12 @@ QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject
}
}
if (object) {
if (const QWidget *widget = qobject_cast<const QWidget *>(object)) {
QStyleSheetStyle *style = const_cast<QStyleSheetStyle *>(globalStyleSheetStyle);
if (!style) {
if (const QWidget *widget = qobject_cast<const QWidget *>(object)) {
style = qobject_cast<QStyleSheetStyle *>(widget->style());
if (style)
fixupBorder(style->nativeFrameWidth(widget));
}
}
if (!style)
style = qobject_cast<QStyleSheetStyle *>(widget->style());
if (style)
fixupBorder(style->nativeFrameWidth(widget));
}
if (hasBorder() && border()->hasBorderImage())
defaultBackground = QBrush();