Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Access QML DSM state properties like 'id', 'onEntry', ... in C++
QtWS25 Last Chance

Access QML DSM state properties like 'id', 'onEntry', ... in C++

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 819 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.
  • C Offline
    C Offline
    Christopher
    wrote on last edited by
    #1

    Hello,

    I'm able to access properties like objectName, guard, signal for a QML DSM SignalTransition.

    Is there a way to access the id as a String and maybe the QQmlScriptString for the onEntry and onExited properies for a QML DSM State?

    DSM.State {
       id: showWidgetState  // How can I access this as a string in C++?
       onEntered: showWidget()  // How can I access this QQmlScriptString in C++?
       onExited: hideWidget()  // How can I access this QQmlScriptString in C++?
    
       DSM.SignalTransition {
          signal: widgetSignal // I can access this as a string in C++
          guard: something === true // I can access this as a string in C++
          targetState: anotherState // I can access this state in C++
       }
    }
    

    Thank you,

    Christopher

    p3c0P 1 Reply Last reply
    0
    • C Christopher

      Hello,

      I'm able to access properties like objectName, guard, signal for a QML DSM SignalTransition.

      Is there a way to access the id as a String and maybe the QQmlScriptString for the onEntry and onExited properies for a QML DSM State?

      DSM.State {
         id: showWidgetState  // How can I access this as a string in C++?
         onEntered: showWidget()  // How can I access this QQmlScriptString in C++?
         onExited: hideWidget()  // How can I access this QQmlScriptString in C++?
      
         DSM.SignalTransition {
            signal: widgetSignal // I can access this as a string in C++
            guard: something === true // I can access this as a string in C++
            targetState: anotherState // I can access this state in C++
         }
      }
      

      Thank you,

      Christopher

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by p3c0
      #2

      @Christopher

      How can I access this as a string in C++?

      AFAIK id is a special property attribute and hence it cannot be accessed from C++ or even from QML.

      Not sure of the rest :)

      157

      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