QmlDesigner: do no refresh if there is no parent

Change-Id: I2299437ea97e884f4b7734129eec8246c87208ab
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Tim Jenssen
2016-01-21 12:29:00 +01:00
parent 626ca46844
commit bc08c10764

View File

@@ -580,15 +580,17 @@ void QuickItemNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParen
setPropertyVariant("y", y()); setPropertyVariant("y", y());
} }
refresh(); if (quickItem()->parentItem()) {
if (quickItem()->window()) refresh();
DesignerSupport::updateDirtyNode(quickItem()); if (quickItem()->window())
DesignerSupport::updateDirtyNode(quickItem());
if (instanceIsValidLayoutable(oldParentInstance, oldParentProperty)) if (instanceIsValidLayoutable(oldParentInstance, oldParentProperty))
oldParentInstance->refreshLayoutable(); oldParentInstance->refreshLayoutable();
if (instanceIsValidLayoutable(newParentInstance, newParentProperty)) if (instanceIsValidLayoutable(newParentInstance, newParentProperty))
newParentInstance->refreshLayoutable(); newParentInstance->refreshLayoutable();
}
} }
void QuickItemNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value) void QuickItemNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)