Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ListView is (very) slow to move to current item
Qt 6.12 LTS is out! See what's new in the release blog

ListView is (very) slow to move to current item

Scheduled Pinned Locked Moved QML and Qt Quick
20 Posts 6 Posters 21.3k 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
    andre
    wrote on last edited by
    #11

    [quote author="Alexander Kuchumov" date="1292868441"]Andre, where is it in QListView? QListView also evaluates height for all elements.[/quote]
    It is right "here":http://doc.qt.nokia.com/4.6/qlistview.html#uniformItemSizes-prop. You can tell QListView that the items are all the same size, and then it only evaluates the hight of the first item.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #12

      Andre, I've missed this function:)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #13

        Don't :-) It can make a huge difference in QListViews performance.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MartinJ
          wrote on last edited by
          #14

          positionViewAtIndex() does not calculate the height of intermediary items. That is the point of that function.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexander
            wrote on last edited by
            #15

            MartinJ is right, positionViewAtIndex uses averageSize .

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #16

              How is averageSize calculated? It is not a property of the ListView element, so where does it come from?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alexander
                wrote on last edited by
                #17

                Andre, averageSize is calculated for last visible elements.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #18

                  OK, that makes sense I guess.

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #19

                    Hi, I have a problem similar to yours. I have a ListView with possibly thousands of elements. I keep a property in my PySide backend which is the currentIndex for my ListView. Whenever I change the index, the ListView should scroll to the current item.

                    It works, but the scrolling is very slow. I think it is the same problem you are describing. Do you have any idea how should I solve my case?

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #20

                      Anybody has a suggestion? I have the same problem on my arm 300 mhz device... I also want to drop the scroll animation and just jump immediately to the next item.

                      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
                      • Unsolved