![]() ![]() In order to achieve this, we need to create a final state and make it the target of a transition associated with the Quit button's clicked() signal. ![]() Sharing Transitions By Grouping StatesĪssume we wanted the user to be able to quit the application at any time by clicking a Quit button. When the state machine enters a top-level final state, the machine will emit the QStateMachine::finished() signal and halt.Īll you need to do to introduce a final state in the graph is create a QFinalState object and use it as the target of one or more transitions. In order for a state machine to be able to finish, it needs to have a top-level final state ( QFinalState object). The state machine defined in the previous section never finishes. QObject ::connect(s3, & QState ::exited, button, & QPushButton ::showMinimized) Ĭustom states can reimplement QAbstractState::onEntry() and QAbstractState::onExit(). QObject ::connect(s3, & QState ::entered, button, & QPushButton:showMaximized) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |