Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
Description
Reproducer attached. It contains 2 tests: "doesnotwork1" and "doesnotwork2". Both try to obtain the <content> QScxmlEvent::data. The first test sends out <content expr="'should see string'"/> from state machine and gets QVariant(void*, 0x0). The second test sends out <content expr="foo"/> and gets the same QVariant(void*, 0x0).
What happens here is that I think Qt handles <content> in a way that its "expr" is always treated as an id of some data model. In the first test, there is no datamodel at all. In the second test, the <data> is named "FOO" instead of "foo". So Qt cannot match anything in either situation. In fact, if one changes the id in the second test then it's going to wotks.
Therefore, I think it is better to:
1. Fix this behavior or warn people in documentation (that <content expr=> only accepts data id)
2. Add some warning messages in Qt source to warn people in compile/runtime too, i.e. Qt cannot match anything with the current expr.