Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-67

Transition always enter the first transitions

XMLWordPrintable

    • 0
    • Sprint 4.1/2021, QUL Sprint 4.2/2021, QUL Sprint 4.3/2021

      here is the demo code, when click the button to change the state, the transition only enter the first one.

      import QtQuick
      import QtQuick.Controls
      Rectangle {
          id: root
          color: "#000000"
          width: 800
          height: 480
          state: "init"
          states: [
              State {
                  name: "welcome"
              },
              State {
                  name: "ignon"
              },
              State {
                  name: "ignoff"
              }
          ]
          onStateChanged: console.log("onStateChanged", state)
          transitions: [
              Transition {
                  to: "welcome"
                  ScriptAction {script: console.log("welcome")}
              },
              Transition {
                  to: "ignon"
                  ScriptAction {script: console.log("ignon")}
              },
              Transition {
                  to: "ignoff"
                  ScriptAction {script: console.log("ignoff")}
              }
          ]
          Row {
              Button {
                  text:"welcome"
                  onClicked: root.state = "welcome"
              }
              Button {
                  text: "ignon"
                  onClicked: root.state = "ignon"
              }
              Button {
                  text: "ignoff"
                  onClicked: root.state = "ignoff"
              }
          }
      }
      
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jan-karasinski Jan Karasiński
            jiu shanheng jiu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes