-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.8.4, 6.9.1, 6.10.0 Beta2
-
None
-
Windows 10 22H2, MSVC 2022 x64
Let's make a slight modification to the example at QTBUG-139463:
import QtQuick import ValueTypeStudy Window { width: 640 height: 480 visible: true property myStructuredType t: ({ number: 42, truth: true }) Component.onCompleted: { console.log("=== Component Complete ===") console.log(t.toString()) } }
There are no more compiler warnings now. However, other issues stand out.
Outcomes
Constructing: 0 false Constructing: 0 false Setting number: 42 Setting truth: true qml: === Component Complete === Constructing: 0 false qml: myStructuredType(42, true)
- At initialization, the default constructor is called twice.
- Note: It is only called once if AOT compilation is suppressed, e.g. by adding NO_CACHEGEN or by adding an invalid property (as QTBUG-139463 did)
- At completion, the default constructor is called when referencing an existing instance: console.log(t.toString())