[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>
bb10
Albert Astals Cid 2018-10-30 17:39:05 +01:00 committed by Christian Ehrlicher
parent 1e9e9acae7
commit ae0dd3201b
1 changed files with 1 additions and 1 deletions

View File

@ -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);