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 + ScrollBar performance
QtWS25 Last Chance

ListView + ScrollBar performance

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 4 Posters 5.8k Views
  • 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.
  • L Offline
    L Offline
    lukasf
    wrote on last edited by
    #1

    QAbstractItemModel + ListView with >300 items

    Each item is represented by a rectangle and some text. Flicking through such a long list of items is somewhat strenuous, so I decided to add a scrollbar to both display the current position as well as enable the user to quickly jump somewhere else.

    My scrollbar is similar to but not as sophisticated as the implementation by "gregschlom":http://bitbucket.org/gregschlom/qmlscrollbar/src/tip/ScrollBar.qml
    The basic functionality is the same: modify the contentY variable of a Flickable / ListView.

    If the user wants to jump from one end to the other, the entire application freezes for a few seconds (at least this is what it feels like). I am aware of the fact that in this case all delegate instances have to be replaced by new ones. Nevertheless, it does seem strange that jumping in a ListView appears to be more time-consuming than creating the entire model in the first place.
    Utilizing cacheBuffer helps for smaller lists, but setting cacheBuffer to 100000 is not an option :)

    Is it possible to perform this task in a faster way?

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

      when ListView jump to end, it read all elements from model to calcualte its sizes. It's problem to ListView, which has many items.

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

        Why would it do that? Note that this is about the Quick ListView, not the QListView widget.

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

          Andre, I see, but Quick ListView also read all elements from model from first item to scrolled item.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            arno5m
            wrote on last edited by
            #5

            http://developer.qt.nokia.com/forums/viewthread/2567/
            describe also same behavior.

            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