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. state error
Forum Updated to NodeBB v4.3 + New Features

state error

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 184 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
    Cheng shi hua
    wrote on last edited by Cheng shi hua
    #1

    property var baodu: 100

    states: [
    State {
    name: "awake"
    PropertyChanges { target: root }
    },
    State {
    name: "idle"
    PropertyChanges { target: root; }
    }
    ]
    transitions: [
    Transition {
    enabled: alive
    from: ""; to: "awake"
    ParallelAnimation {
    SequentialAnimation {
    NumberAnimation { target: root; property: "scale"; to: 2; duration: 100 }
    NumberAnimation { target: root; property: "scale"; to: 1; duration: 500 }
    }
    ScriptAction {
    script: {
    ani0.start()
    baodu -= 1
    }
    }
    }
    },
    Transition {
    enabled: alive
    from: "
    "; to: "idle"
    ParallelAnimation {
    ScriptAction {
    script: {
    baodu -= 1
    ani0.start()
    console.log("idle start")
    }
    }
    }
    }
    ]

    Component.onCompleted: {
    state = "awake"
    }

    onBaoduChanged: {
        state = "idle"
    }
    

    result: <Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.

    I only change the property baodu -= 1

    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