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. Implementing a custom data model for SCXML

Implementing a custom data model for SCXML

Scheduled Pinned Locked Moved Solved General and Desktop
scxmldata model
2 Posts 1 Posters 1.0k 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.
  • P Offline
    P Offline
    Phrogz
    wrote on 15 Apr 2016, 20:12 last edited by Phrogz
    #1

    I'm using Qt with an SCXML state machine. I want to use the native Qt SCXML interpreter via QScxmlStateMachine. However, Qt only supports Null, EcmaScript, and C++ data models for SCXML. My state machine has a custom data model.

    I would like to subclass QScxmlDataModel to support my state machine. I can see how implementing the setup(), hasScxmlProperty(), setScxmlProperty(), and scxmlProperty() functions would allow setting/getting values from the data model. However, I don't see how to make it so that expressions and other model-specific items—such as with <transition cond="..."> or <script>...</script>—will properly be evaluated in my custom data model.

    How can I make a custom data model that knows how to do more than just get/set properties?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Phrogz
      wrote on 20 Apr 2016, 15:13 last edited by
      #2

      Answered on StackOverflow. The key is that there are many functions hidden from the documentation that need to be overridden, like evaluateToString().

      1 Reply Last reply
      1

      1/2

      15 Apr 2016, 20:12

      • Login

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