What is "State" used for?
-
Guys am kinda confused about the use of "Qt State"...is it some kind of tabpage, I mean it switches controls on it?
And how do I use it on a mainPage? Could it be...
@mainPage.state = 'State1'@
mine don't work
-
The state attribute, as you may expect, stores and sets what state something is in. This is the QML equivalent of the "Qt C++ State Machine Framework":http://qt-project.org/doc/qt-4.8/statemachine-api.html.
You define some states in your QML object, usually define some transitions which should happen on entering each state, and set up the logic of your application to enter certain states on certain events.
This "example":http://qt-project.org/doc/qt-4.8/declarative-animation-states.html shows how you could go about using states in your application. -
It is not really equivalent. It is a much simpler solution than the state machine framework in Qt offers, but on the other hand every item can have it's own state.