mainitem can be null according to the if() below, so respect that
This commit is contained in:
parent
dd95295cb0
commit
201baafc1c
@ -106,9 +106,11 @@ void DialogProxy::setMainItem(QGraphicsObject *mainItem)
|
|||||||
{
|
{
|
||||||
if (m_mainItem.data() != mainItem) {
|
if (m_mainItem.data() != mainItem) {
|
||||||
if (m_mainItem) {
|
if (m_mainItem) {
|
||||||
m_mainItem.data()->setParent(mainItem->parent());
|
m_mainItem.data()->setParent(mainItem ? mainItem->parent() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mainItem = mainItem;
|
m_mainItem = mainItem;
|
||||||
|
|
||||||
if (mainItem) {
|
if (mainItem) {
|
||||||
mainItem->setParentItem(0);
|
mainItem->setParentItem(0);
|
||||||
mainItem->setParent(this);
|
mainItem->setParent(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user