Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt for MCUs 2.2.4, Qt for MCUs 2.6, Qt fo MCUs 2.5.2
-
None
-
-
604fc9fd, 55c1583b, b62f6d4e, e13b4685
Description
Having a white space in the name property of State causes a compilation error in Qt for MCUs while it doesn't in Qt6.
With this code:
import QtQuickRectangle { id: root color: "black" MouseArea { id: mouseArea anchors.fill: parent } states: [ State { name: "red screen" // <-- space is there when: mouseArea.pressed PropertyChanges { target: root; color: "red" } }, State { name: "blue screen" // <-- space is there when: "Hello" === "World" PropertyChanges { target: root; color: "blue" } } ] }
I got this error in the generated C++ code. (basically a lot, due to the white space. Please try this out with the attached project 01_Define_and_Transition_States.zip)
I also attached a simple example(untitled6.aip) which builds with Qt 6.6. This works.
// main.qml import QtQuick import contentWindow { id: root visible:true width: 472; height: 272 Rectangle { id: rect anchors.fill: parent color: "black" MouseArea { id: mouseArea anchors.fill: parent onPressed: { console.log("pressed") } } states: [ State { name: "red screen" // <-- space when: mouseArea.pressed PropertyChanges { target: rect; color: "red" } }, State { name: "blue screen" // < -- space when: mouseArea.released PropertyChanges { target: rect; color: "blue" } } ] } }
Attachments
Issue Links
- mentioned in
-
Page Loading...