Commit d700b847 authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlDesigner: Fix crash when opening a .qml file with states

This fixes an assert in QGraphicsScene because of
overlapping deferred calls of _q_processDirtyItems & _q_emitUpdated.
Both used to be queued in the same event loop:

 _q_emitUpdated call queued with "calledEmitUpdated=true"
 _q_processDirtyItems call queued
-> Event loop runs
 _q_emitUpdated runs, setting "calledEmitUpdated=false"
 _q_processDirtyItems runs, asserting because of !calledEmitUpdated

This fix forces the event loop to run between the queueing of
_q_emitUpdated & _q_processDirtyItems, effectively separating
both calls.

Task-number: BAUHAUS-459
Reviewed-by: Christiaan Janssen
parent 651ff4b1
......@@ -166,6 +166,10 @@ StatesEditorWidget::StatesEditorWidget(QWidget *parent):
m_d->listView->rootContext()->setContextProperty(QLatin1String("statesEditorModel"), m_d->;
// Work around ASSERT in the internal QGraphicsScene that happens when
// the scene is created + items set dirty in one event loop run (BAUHAUS-459)
if (!m_d->listView->rootObject())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment