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. Qt5 ListView switch items animation
Forum Updated to NodeBB v4.3 + New Features

Qt5 ListView switch items animation

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 1.6k 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.
  • V Offline
    V Offline
    vladstelmahovsky
    wrote on last edited by
    #1

    Hi

    is there is a way to change animation of switching items in ListView?

    thanks

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      I think addDisplaced and displaced is what you are looking for

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vladstelmahovsky
        wrote on last edited by
        #3

        Hi Jens

        thanks for you reply
        tried to add
        @displaced: Transition {}
        addDisplaced: Transition {}@

        but the behavior is still the same

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jens
          wrote on last edited by
          #4

          Transition{} itself doesnt do any animation. You need to add something to it. i.e:

          @add: Transition {
          NumberAnimation { properties: "x,y"; from: 100; duration: 1000 }
          }@

          See the ListView docs for fore examples.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vladstelmahovsky
            wrote on last edited by
            #5

            Exactly!
            I do not want any animation :)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ashaihullin
              wrote on last edited by
              #6

              Does it work with self implemented QAbstractListModel?
              I tried, but no animation happens on add, remove, etc...

              @ beginInsertRows( QModelIndex(), rowCount(), rowCount() );
              m_list << entity;
              endInsertRows();@

              @add: Transition {
              SequentialAnimation {
              NumberAnimation { property: "opacity"; from: 1; to: 0.0; duration: 400 }
              NumberAnimation { property: "scale"; from: 1; to: 0.0; duration: 400 }
              }
              }@

              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