Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.0
-
None
-
Operating System: openSUSE Tumbleweed 20250602
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.15.0-1-default (64-bit)
Graphics Platform: X11
Description
Run the following code and flick the switch:
pragma ComponentBehavior: Bound import QtQuick import QtQuick.Controls Window { id: root width: 640 height: 480 visible: true title: "Default window title" Loader { id: desktopMainContent anchors.centerIn: parent sourceComponent: Item { Switch { id: mySwitch anchors { verticalCenter: parent.verticalCenter right: parent.horizontalCenter } } Label { id: label anchors { verticalCenter: parent.verticalCenter left: parent.horizontalCenter } text: "Default label text" } states: State { name: "inCustomState" when: mySwitch.checked changes: [ PropertyChanges { //! [0] root.title: "In state" //! [0] //! [1] // target: root // title: "In state" //! [1] }, PropertyChanges { label.text: root.title } ] } } } }
You will notice that the window title doesn't change as expected. In the application output I get qrc:/qt/qml/playground/Main.qml:39:21: QML PropertyChanges: Cannot assign to non-existent property "root.title".
If you comment out the code in [0] and uncomment the code in [1], the app works as expected.
The issue here is that the code in [1] triggers Quick.property-changes-parsed in qmllint. So either the the code in [0] should work as expected, or the qmllint issue should have an exception for PropertyChanges in a Loader.