QmlDesigner: Improve return values

You can return by const reference if you the ownership of the return
value is non local. If it is local you should return by value. In that
case it should be non const because otherwise the compile cannot move
the return value.

Change-Id: I2a4b08dd0e67a2c2741a46bdd7def842c1db3fbf
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Marco Bubke
2020-11-16 14:51:46 +01:00
parent 2d5a6818f2
commit 382aed1f72
16 changed files with 40 additions and 41 deletions

View File

@@ -348,7 +348,7 @@ void TransitionEditorView::openSettingsDialog()
dialog->show();
}
const QList<ModelNode> TransitionEditorView::allTransitions() const
QList<ModelNode> TransitionEditorView::allTransitions() const
{
if (rootModelNode().isValid() && rootModelNode().hasProperty("transitions")) {
NodeAbstractProperty transitions = rootModelNode().nodeAbstractProperty("transitions");