-
QStateMachine
I'm trying to use QStateMachine with QWebPage and I'm stuck in the middle of nowhere.
I'm using qwebpage to load and navigate through a site. During this navigation I have to make a series of actions like connect, login, query, logout, login, query, query, logout, disconnect. So I have my class Session modeling this with abstract methods login, query, logout etc. I also created a state machine inside this class using QStateMachine class. Loading each page is signaled by emitting loadFinished(bool) signal by qwebpage. I have to make sure the next action is not taken until after the previous page is loaded (what means waiting for loadFinished(bool) signal).
What should I do inside loadFinished(bool) and in my methods so that they make use of a state machine to control what actions are made in what moments?
-
Re: QStateMachine
You have to implement your slot, which will be connected to loadFinished. Once the page is loaded completely the signal will be emitted and your slot will start execution.
-
Re: QStateMachine
How can be checked in which state is statemachine, I cannot get this info form docs ...?
-
Re: QStateMachine
Listen for entered() signal from the states.