guard against crash
This commit is contained in:
parent
25c6e9800a
commit
3475f99f96
@ -133,12 +133,18 @@ void DialogProxy::syncMainItem()
|
||||
QGraphicsObject *qo = qobject_cast<QGraphicsObject *>(parent);
|
||||
if (qo) {
|
||||
scene = qo->scene();
|
||||
scene->addItem(m_mainItem.data());
|
||||
break;
|
||||
if (scene) {
|
||||
scene->addItem(m_mainItem.data());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!scene) {
|
||||
return;
|
||||
}
|
||||
|
||||
//the parent of the qobject never changed, only the parentitem, so put it back what it was
|
||||
m_mainItem.data()->setParentItem(qobject_cast<QGraphicsObject *>(m_mainItem.data()->parent()));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user