Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can I use QStateMachine to simulate a flow processing? And how?

Can I use QStateMachine to simulate a flow processing? And how?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 220 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sauntor
    wrote on last edited by aha_1980
    #1

    Is there a way/simple way to archive a flow as bellow just using QStateMachine or other Qt components:

    7e1f27ff-9393-4571-bf5e-2554289c3a1c-image.png

    A detailed case:

    1. using QNetworkAccessManager to login http://example.org/login , this step may repeat for retrying
    2. if login not success, show failure and exit
    3. if login success, fetch user's profile(http://example.org/profile), notes (http://example.org/notes), and mails (http://example.org/mails)
    4. combine all data got in step 3, show it to the user
    JonBJ 1 Reply Last reply
    0
    • S Sauntor

      Is there a way/simple way to archive a flow as bellow just using QStateMachine or other Qt components:

      7e1f27ff-9393-4571-bf5e-2554289c3a1c-image.png

      A detailed case:

      1. using QNetworkAccessManager to login http://example.org/login , this step may repeat for retrying
      2. if login not success, show failure and exit
      3. if login success, fetch user's profile(http://example.org/profile), notes (http://example.org/notes), and mails (http://example.org/mails)
      4. combine all data got in step 3, show it to the user
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Sauntor
      You have not received an answer, I have not actually used QStateMachine. 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 ?

      S 1 Reply Last reply
      0
      • JonBJ JonB

        @Sauntor
        You have not received an answer, I have not actually used QStateMachine. 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 ?

        S Offline
        S Offline
        Sauntor
        wrote on last edited by Sauntor
        #3

        @JonB By what I know now, if implement this flow, one should create at least tow mediator component for choice node and join node, and many other intermediate QState for transitions.
        That's too complicated! 😂
        If you do not use state machine, things may go a little simple! But it's still complicate 😂

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved