From 82cb34b05f59b3e3f2d641304381ea9d359bc67b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 23 Oct 2012 11:50:13 +0300 Subject: [PATCH] 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 Reviewed-by: Thomas Hartmann --- src/widgets/styles/qstylesheetstyle.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 1c4cad7afe..17ed82c730 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -997,16 +997,12 @@ QRenderRule::QRenderRule(const QVector &declarations, const QObject } } - if (object) { + if (const QWidget *widget = qobject_cast(object)) { QStyleSheetStyle *style = const_cast(globalStyleSheetStyle); - if (!style) { - if (const QWidget *widget = qobject_cast(object)) { - style = qobject_cast(widget->style()); - if (style) - fixupBorder(style->nativeFrameWidth(widget)); - } - } - + if (!style) + style = qobject_cast(widget->style()); + if (style) + fixupBorder(style->nativeFrameWidth(widget)); } if (hasBorder() && border()->hasBorderImage()) defaultBackground = QBrush();