// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import QtQuick 2.0 Rectangle { width: 200; height: 200 CustomObject { id: theObject } function doSomethingDirect() { theObject.prop1 = 0; for (var i = 0; i < 1000; ++i) theObject.prop1 += theObject.prop2; theObject.prop3 = theObject.prop1; } function doSomethingLocalObj() { theObject.prop1 = 0; var incrementObj = theObject; for (var i = 0; i < 1000; ++i) incrementObj.prop1 += incrementObj.prop2; incrementObj.prop3 = incrementObj.prop1; } function doSomethingLocal() { theObject.prop1 = 0; var increment = theObject.prop2; for (var i = 0; i < 1000; ++i) theObject.prop1 += increment; theObject.prop3 = theObject.prop1; } }