forked from qt-creator/qt-creator
QmlDesigner: Fix for changing type
The type of the root node is handled differently. Change-Id: I360095c97184230502c8d80fbcb7ef7815f0a177 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -187,7 +187,10 @@ void PropertyEditorContextObject::changeTypeName(const QString &typeName)
|
|||||||
Core::AsynchronousMessageBox::warning(tr("Invalid Type"), tr("%1 is an invalid type.").arg(typeName));
|
Core::AsynchronousMessageBox::warning(tr("Invalid Type"), tr("%1 is an invalid type.").arg(typeName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
selectedNode.changeType(metaInfo.typeName(), metaInfo.majorVersion(), metaInfo.minorVersion());
|
if (selectedNode.isRootNode())
|
||||||
|
rewriterView->changeRootNodeType(metaInfo.typeName(), metaInfo.majorVersion(), metaInfo.minorVersion());
|
||||||
|
else
|
||||||
|
selectedNode.changeType(metaInfo.typeName(), metaInfo.majorVersion(), metaInfo.minorVersion());
|
||||||
|
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
} catch (RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
|
} catch (RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
|
||||||
|
|||||||
Reference in New Issue
Block a user