Can I use QStateMachine to simulate a flow processing? And how?
-
Is there a way/simple way to archive a flow as bellow just using QStateMachine or other Qt components:
A detailed case:
- using QNetworkAccessManager to login http://example.org/login , this step may repeat for retrying
- if login not success, show failure and exit
- if login success, fetch user's profile(http://example.org/profile), notes (http://example.org/notes), and mails (http://example.org/mails)
- combine all data got in step 3, show it to the user
-
Is there a way/simple way to archive a flow as bellow just using QStateMachine or other Qt components:
A detailed case:
- using QNetworkAccessManager to login http://example.org/login , this step may repeat for retrying
- if login not success, show failure and exit
- if login success, fetch user's profile(http://example.org/profile), notes (http://example.org/notes), and mails (http://example.org/mails)
- combine all data got in step 3, show it to the user
-
@Sauntor
You have not received an answer, I have not actually usedQStateMachine
. But, yes, you can achieve what you want/shown in the diagram. In terms of how, did you read through https://doc.qt.io/qt-6/qtstatemachine-cpp-guide.html ?@JonB By what I know now, if implement this flow, one should create at least tow mediator component for
choice
node andjoin
node, and many other intermediateQState
for transitions.
That's too complicated! 😂
If you do not use state machine, things may go a little simple! But it's still complicate 😂