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. ListView - SmoothedAnimation -> How to stop animation at specific item
Forum Updated to NodeBB v4.3 + New Features

ListView - SmoothedAnimation -> How to stop animation at specific item

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

    I want to simulate scrooling and generally it works, but I don't know how to stop at specific item. Is there any parameter which set position, where animation should be stopped?
    Height of infinite list is 200 px.

                SmoothedAnimation
                {
                    target: listviewID
                    easing.type: Easing.InQuart
                    property: "contentY"
                    running: true
                    velocity: 4*200
                    duration: 1000
                    from: 0
                    to: 5 * 200
                }
    

    2302e66e-a671-47c1-9393-a7b6e878d9cf-obraz.png

    1 Reply Last reply
    0
    • P Offline
      P Offline
      PawlosCK
      wrote on last edited by
      #2

      Problem solved. It's working animation which changing items in ListView

                  SmoothedAnimation
                  {
                      id: animacja1
                      target: listviewID
                      easing.type: Easing.OutCubic
                      property: "contentY"
                      running: animacja_running
                      duration: animation_value * mainListView.animation_height
                      from: listviewID.contentY
                      to: listviewID.contentY + (mainListView.animation_value * mainListView.animation_height)
                  }
      

      mainListView.animation_value - how many items. Value > 0 -> increasing index, Value < 0 -> decreasing index
      mainListView.animation_height - height of item

      You can change it using this function

          function xx_ustaw(x_value, x_height)
          {
              object_value3.animation_height = x_height
              object_value3.animation_value = x_value
              object_value3.animacja_running = true
          }
      
      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