Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.10
-
None
-
Linux
-
76da60b5ad388b6873f496b07b2c3ccabe9c9490
Description
If I make a rectangle with var foo = Qt.rect()
I can do foo.x = 100;
If I make the rectangle with var foo = someCppObject.rectProperty
foo.x = 100 silently has no effect.
Given it should be a copy of the data (like int or strings) I should be able to modify it.
Simple code example explains the problem:
import QtQuick 2.7 import QtQuick.Window 2.0 Window { visible: true width: 640 height: 680 title: qsTr("qtbug64115") Item { id: root Component.onCompleted: { console.log("=====PART 1=====") var rect = Qt.rect(50, 50, 100, 100) console.log(rect.x) //outputs 50 rect.x += 500 console.log(rect.x) //outputs 550 console.log("=====PART 2=====") var rect2 = root.childrenRect console.log(rect2.x) //outputs 50 rect2.x += 500 console.log(rect2.x) //BUG!!! Should be 550, output is still 50 } Item { x: 50 width: 100 y: 50 height: 100 } } }