summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2018-10-30 17:39:05 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-11-12 19:00:30 +0000
commitae0dd3201bc13b81c62752bb04e42362c78bfe16 (patch)
tree35eadd58081c4911f6e1f4777424fda8b33cbce1 /src/widgets/styles/qstylesheetstyle.cpp
parent1e9e9acae7b352920f55843dc6c2a0819276fb4f (diff)
[Micro]optimization in QStyleSheetStyle::drawComplexControl
Only copy QStyleOptionSlider when needed Change-Id: I9d9d8d40fa9ed8b7be4f6a32afa8bf68f64d7836 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 3e397c9e04..121de548b0 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -3246,8 +3246,8 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
#if QT_CONFIG(scrollbar)
case CC_ScrollBar:
if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- QStyleOptionSlider sbOpt(*sb);
if (!rule.hasDrawable()) {
+ QStyleOptionSlider sbOpt(*sb);
sbOpt.rect = rule.borderRect(opt->rect);
rule.drawBackgroundImage(p, opt->rect);
baseStyle()->drawComplexControl(cc, &sbOpt, p, w);