forked from qt-creator/qt-creator
QmlDesigner: Avoid detachs
The non const overloads of first() and last() do detach if the reference count is higher than 1. Therefore we use constFirst() and constLast() instead. Change-Id: I737cfc428f1c21f16185b9b51175e181c0ec7068 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -138,7 +138,7 @@ static void openComponentSourcePropertyOfLoader(const ModelNode &modelNode)
|
||||
* the default property is always implcitly a NodeListProperty. This is something that has to be fixed.
|
||||
*/
|
||||
|
||||
componentModelNode = modelNode.nodeListProperty("component").toModelNodeList().first();
|
||||
componentModelNode = modelNode.nodeListProperty("component").toModelNodeList().constFirst();
|
||||
}
|
||||
|
||||
Core::EditorManager::openEditor(componentModelNode.metaInfo().componentFileName(), Core::Id(), Core::EditorManager::DoNotMakeVisible);
|
||||
|
||||
Reference in New Issue
Block a user