Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt Creator 15.0.1, Qt Creator 16.0.0-beta2
-
Windows 10 22H2
Description
Code
import QtQuick import SingletonTest Window { width: 640 height: 480 visible: true color: ConstantsSingleton.col ConstantsInstantiable { id: ci } Rectangle { width: 100 height: 100 anchors.centerIn: parent color: ci.col } }
Steps to reproduce
- Load the attached project in Qt Creator
- Open Main.qml and select "Build" > "QML Preview"
- Open ConstantsInstantiable.qml and change the value of col to a different colour
- Open ConstantsSingleton.qml and change the value of col to a different colour
Outcomes
- Step #2: The preview window appears (Expected)
- Step #3: In the preview window, the central square changes to your new colour (Expected)
- Step #4: In the preview window, the window background remains the old colour (Not Expected)
Other Notes
Even though the final result is ignored, the intermediate values in ConstantsSingleton.qml do affect the preview as described in QTCREATORBUG-32409. In the middle of doing Step #4, the preview window disappears and the General Message pane shows this:
Error loading QML Live Preview: qrc:/qt/qml/SingletonTest/Main.qml:9 Type ConstantsInstantiable unavailable qrc:/qt/qml/SingletonTest/ConstantsInstantiable.qml:-1 Type ConstantsSingleton unavailable qrc:/qt/qml/SingletonTest/ConstantsSingleton.qml:5 Invalid property assignment: color expected
(I'm not sure why it's complaining about ConstantsInstantiable which is in a good state - ConstantsSingleton is the one that contained the invalid colour string)