QMacStyle::drawControl(CE_ProgressBar): add missing null pointer check
Do not spin off progress bar animations if QStyleOption::styleObject is not set. Task-number: QTBUG-29748 Change-Id: I4e17a4892e82cae48250afa7a270b15ca5730f46 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
fcef9b4252
commit
c90626f189
@ -4259,7 +4259,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
||||
if (isIndeterminate || tdi.value < tdi.max) {
|
||||
if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
|
||||
tdi.trackInfo.progress.phase = animation->animationStep();
|
||||
else
|
||||
else if (opt->styleObject)
|
||||
d->startAnimation(new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject));
|
||||
} else {
|
||||
d->stopAnimation(opt->styleObject);
|
||||
|
Loading…
Reference in New Issue
Block a user