forked from qt-creator/qt-creator
QmlDesigner: Fix crash
In doTransition we start and stop animations. Therefore the lookup for anim has to be done separately. Task-number: QDS-9621 Change-Id: I608799a997d48acef7496a985505f896113068d1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
fd06bc9eca
commit
1ecc500e5d
@@ -629,9 +629,9 @@ void ManhattanStyle::drawPrimitiveForPanelWidget(PrimitiveElement element,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PE_PanelButtonTool: {
|
case PE_PanelButtonTool: {
|
||||||
bool animating = (state & State_Animating);
|
|
||||||
Animation *anim = d->animator.widgetAnimation(widget);
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
const bool animating = (state & State_Animating);
|
||||||
|
|
||||||
if (widget && !animating) {
|
if (widget && !animating) {
|
||||||
auto w = const_cast<QWidget *> (widget);
|
auto w = const_cast<QWidget *> (widget);
|
||||||
int oldState = w->property("_q_stylestate").toInt();
|
int oldState = w->property("_q_stylestate").toInt();
|
||||||
@@ -651,6 +651,7 @@ void ManhattanStyle::drawPrimitiveForPanelWidget(PrimitiveElement element,
|
|||||||
if (doTransition) {
|
if (doTransition) {
|
||||||
QImage startImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied);
|
QImage startImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
QImage endImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied);
|
QImage endImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
|
Animation *anim = d->animator.widgetAnimation(widget);
|
||||||
QStyleOption opt = *option;
|
QStyleOption opt = *option;
|
||||||
opt.state = (QStyle::State)oldState;
|
opt.state = (QStyle::State)oldState;
|
||||||
opt.state |= State_Animating;
|
opt.state |= State_Animating;
|
||||||
@@ -680,6 +681,8 @@ void ManhattanStyle::drawPrimitiveForPanelWidget(PrimitiveElement element,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Animation *anim = d->animator.widgetAnimation(widget);
|
||||||
|
|
||||||
if (!animating && anim) {
|
if (!animating && anim) {
|
||||||
anim->paint(painter, option);
|
anim->paint(painter, option);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user