diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-10-23 11:50:13 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-25 10:20:27 +0200 |
commit | 82cb34b05f59b3e3f2d641304381ea9d359bc67b (patch) | |
tree | d64e33583e285591499c30fcc51411e7fcb4bd01 /src/widgets | |
parent | b5d55f3a353313735f3b26448961a5722c0bf669 (diff) |
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>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 14 |
1 files 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<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(); |