Skip to content

Commit

Permalink
[Micro]optimization in QStyleSheetStyle::drawComplexControl
Browse files Browse the repository at this point in the history
Only copy QStyleOptionSlider when needed

Change-Id: I9d9d8d40fa9ed8b7be4f6a32afa8bf68f64d7836
Reviewed-by: Christian Ehrlicher <[email protected]>
Reviewed-by: Sérgio Martins <[email protected]>
  • Loading branch information
albert-astals-cid-kdab authored and chehrlic committed Nov 12, 2018
1 parent 1e9e9ac commit ae0dd32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/styles/qstylesheetstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ae0dd32

Please sign in to comment.