Commit 4b3acf03 authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Fix a crash moving packages into itself

Change-Id: I1a722b9514ee0a57d8bd8be2f4ea05ed87c6686d
Task-number: QTCREATORBUG-18262
Reviewed-by: Tobias Hunger's avatarTobias Hunger <>
parent 336f54de
......@@ -756,6 +756,13 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
QMT_CHECK(object != m_rootPackage);
// verify that newOwner is not a child of object
MObject *newOwnerObject = newOwner;
while (newOwnerObject && newOwnerObject != object)
newOwnerObject = newOwnerObject->owner();
if (newOwnerObject == object)
if (newOwner != object->owner()) {
int formerRow = 0;
MObject *formerOwner = object->owner();
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