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. Check current state of QHistoryState
Forum Updated to NodeBB v4.3 + New Features

Check current state of QHistoryState

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 242 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.
  • M Offline
    M Offline
    majorRonk
    wrote on last edited by majorRonk
    #1

    How can i see in which current state my QHistoryState is without using private classes (QHistoryStatePrivate) ?
    QStateMachine has a configuration() function to see all active states.
    Somehow QHistoryState does not provide anything useful.

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You can use https://doc.qt.io/qt-6/qabstractstate.html#machine to get the state machine from QHistoryState

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        majorRonk
        wrote on last edited by majorRonk
        #3

        I have already access to this statemachine and statemachine->configuration() gives me the state after i left the substate/historystate. I want to know if a historystate was entered or in which previous state it was.

        Lets say i have two different historystates in my statemachine and i have a stop/resume logic.
        "stop" jumps out of active substate/historystate and "resume" continues the last active historystate.

        The moment when i trigger "resume" i want to know which historystate was the last active one.
        I could save that information as member variable but i was hoping that QHistoryState delivers enough information.

        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