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. Slide animation with anchors problem
Forum Updated to NodeBB v4.3 + New Features

Slide animation with anchors problem

Scheduled Pinned Locked Moved QML and Qt Quick
animationanchorchangesslide
1 Posts 1 Posters 635 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.
  • R Offline
    R Offline
    RodoB
    wrote on 21 May 2015, 15:48 last edited by
    #1

    I don't know how to build a slide animation with an item that is anchored at the sliding direction.
    I get a "expand" like animation, not an item sliding from the bottom up and down.
    I would thank you for some hints.

    Here a code example

    Item {
        anchors.fill: parent
    
        Item {
            id: someItem1
            anchors.top : bottomItem.top // initial state is collapsed
            anchors.right : parent.right
            anchors.left : parent.left
            anchors.bottom : therapyBar.top
    
            //clipping needed for the animation. The dialog has to slide down without
            //disturbing the objects below.
            clip: true
            states: [
                State {
                    name: "collapsed"
                    AnchorChanges {
                        target: someItem1
                        anchors.top:bottomItem.top 
                       // what about the bottom anchor here? I would like to keep a fixed height so it slides down.
                    }
                },
                State {
                    name: "expanded"
                    AnchorChanges {
                        target: someItem1
                        anchors.top:parent.top
                    }
                }
            ]
        }
    
        Item {
            id:bottomItem
            anchors.bottom: parent.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            height: 100
            }
    }
    
    1 Reply Last reply
    0

    1/1

    21 May 2015, 15:48

    • Login

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