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. Transition animation not working
Forum Updated to NodeBB v4.3 + New Features

Transition animation not working

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 747 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.
  • A Offline
    A Offline
    AQTStudent
    wrote on last edited by
    #1

    Hello,
    So I'm making a menu and trying to pop a menu item up on a degree of 74 when selected.
    However, it moves the image but without the animation..
    Can you please take a look what went wrong?
    @ StateGroup {
    id: stateGroup
    states: [
    State {
    name: "State0"
    PropertyChanges {target: iNav; x: 14; y: -50 }
    },
    State {
    name: "State1"
    PropertyChanges {target: iMM; x: 163; y: -50 }
    },
    State {
    name: "State2"
    PropertyChanges {target: iInfo; x: 311; y: -50}
    },
    State {
    name: "State3"
    PropertyChanges {target: iBT; x: 460; y: -50;}
    },
    State {
    name: "State4"
    PropertyChanges {target: iWeb; x: 608; y: -50;}
    }
    ]
    transitions: [
    Transition {
    from: ""; to: "State0"
    PropertyAnimation {target: iNav; duration: 2000; easing.type: Easing.InQuad }
    },
    Transition {
    from: "
    "; to: "State1"
    PropertyAnimation {target: iMM; duration: 2000; easing.type: Easing.InQuad }
    },
    Transition {
    from: ""; to: "State2"
    PropertyAnimation {target: iInfo; duration: 2000; easing.type: Easing.InQuad }
    },
    Transition {
    from: "
    "; to: "State3"
    PropertyAnimation {target: iBT; duration: 2000; easing.type: Easing.InQuad }
    },
    Transition {
    from: "*"; to: "State4"
    PropertyAnimation {target: iWeb; duration: 2000; easing.type: Easing.InQuad }
    }
    ]
    }@

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mp3butcher
      wrote on last edited by
      #2

      mmh, perhaps there's a problem cause you forget the target property..no?
      ex
      @ properties: "opacity";
      from: 0.99;
      to: 1.0@

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        For every animation you need to tell which which property you would like animate. If you want the animation to triggered by default, you can Behaviour on <x> {}
        e.g

        @Rectangle {
        id: rect
        width: 100; height: 100
        color: "red"

        Behavior on x {
            NumberAnimation { duration: 1000 }
        }
        
        MouseArea {
            anchors.fill: parent
            onClicked: rect.width = 50
        }
        

        }@

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        2

        • Login

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