Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.7.2
-
None
-
-
35630eef3 (dev)
Description
In some situations, a property of a QML registered c++ class (in the example called Bar :: p) is unexpectedly written, although it is not altered.
This happens, when:
- the property is assigned to a property of a QML component
- the property is a QList of an enum type
Please, see the attached example code.
The unexpected writing happens when bar.p is assigned to foo.p and foo.p is modified. bar.p should stay unmodified, but it is changed.
// Type exported from C++ via QML_ELEMENT Bar { id: bar onPChanged: { // If "foo" would overwrite bar's "p", the following lines would be reached // This is not expected - BUT does happen! console.log("Bar::onPChanged UNEXPECTEDLY from QML") } } Item { id: foo property var p: bar.p Component.onCompleted: foo.p.push(Bar.World) }
This does not happen, if the property (Bar :: p) is not a QList of enum types, but a QList of int or QString, for example.
Attachments
Issue Links
- duplicates
-
QTBUG-102779 Allow detaching of value types when writing to a QML-defined property
-
- Closed
-