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. [SOLVED] Set the currentIndex of ListView immediately (without animation)
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Set the currentIndex of ListView immediately (without animation)

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 3.9k 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.
  • GianlucaG Offline
    GianlucaG Offline
    Gianluca
    wrote on last edited by
    #1

    Dear all,
    I have a ListView that depending on the user interaction I need to display it starting from a current index different from "0", but without animating it.
    More in details, I have one ListView displaying a list of thumbnail photos, and when the user click on one of them it'll appear a second ListView displaying the photos at fullscreen. This second ListView has to be displayed with the current index set to the thumbnail clicked by the user, and during this setting of current index the animation should be disable. But after that, the user has the possibility to change the current index by two buttons and now the animation has to works.

    So, how can I disable temporarily the animation ?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      Have you tried using

      http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#positionViewAtIndex-method

      I'm not 100% sure it works, but I vaguely remember that using this method does not involve animation. Anyway, worth a shot.

      1 Reply Last reply
      0
      • GianlucaG Offline
        GianlucaG Offline
        Gianluca
        wrote on last edited by
        #3

        Yeahhh, that method works as I need :-)

        Thank you.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Confirmed, this works beautifully, and even can be invoked through the meta object system. Thank you!

          (Z(:^

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Confirmed, this works beautifully, and even can be invoked through the meta object system. Thank you!

            (Z(:^

            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