Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Hi, I am trying to implement state machines using scxml
Qt 6.12 LTS is out! See what's new in the release blog

Hi, I am trying to implement state machines using scxml

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 700 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    RashNav_123
    wrote on last edited by RashNav_123
    #1

    Hello friends,

    I am trying to implement statemachines using scxml.
    I have used states and transitions and i am able to acces the states in qml.
    Same way i have also created a class and tried to create object of state chart and access it in that class.
    I am only able to check the name() of the object.
    Can anyone help me how to check the current state of state machine in cpp.

    JonBJ Pablo J. RoginaP 2 Replies Last reply
    0
    • R RashNav_123

      Hello friends,

      I am trying to implement statemachines using scxml.
      I have used states and transitions and i am able to acces the states in qml.
      Same way i have also created a class and tried to create object of state chart and access it in that class.
      I am only able to check the name() of the object.
      Can anyone help me how to check the current state of state machine in cpp.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @RashNav_123
      Yes you can access them from C++. Have you read through https://doc.qt.io/qt-5/qtscxml-overview.html, and looked at the various examples from https://doc.qt.io/qt-5/examples-qtscxml.html ?

      I admit I know nothing about QML. But if you are having trouble exposing/accessing the class(es) from QML I think you should show the skeleton of what you have tried to do so that QML experts can comment.

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

        From my experience with state machines in SCXML I don't think it is worth your time an effort. It only works OKAY and is significantly more complicated than just using the standard state machine modules offered by qt. It felt like someone had a good idea to implement this but it was never really polished to the typical standard you expect from most Qt modules.

        1 Reply Last reply
        0
        • R RashNav_123

          Hello friends,

          I am trying to implement statemachines using scxml.
          I have used states and transitions and i am able to acces the states in qml.
          Same way i have also created a class and tried to create object of state chart and access it in that class.
          I am only able to check the name() of the object.
          Can anyone help me how to check the current state of state machine in cpp.

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @RashNav_123 said in Hi, I am trying to implement state machines using scxml:

          I am only able to check the name() of the object.

          Could you show your code? Or at least an snippet of what you've tried so far?

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          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
          • Unsolved