Let's consider this code snippet:
ApplicationWindow
{
/**/
states: State {}
/**/
}
When running the application, I get
Cannot assign to non-existent property "states"
When using
ApplicationWindow
{
/**/
Item { states: State {} }
/**/
}
There is no error. Why can't I use states
inside an ApplicationWindow
?
I've just realized that ApplicationWindow
inherits Window
inherits QQuickWindow
. Only types which inherit from Item
have the states
property.
The workaround is to use StateGroup
.
Feel free to add a better solution ;)