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. QML ListView + ScrollArea
Forum Updated to NodeBB v4.3 + New Features

QML ListView + ScrollArea

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 11.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.
  • B Offline
    B Offline
    bunjee
    wrote on 30 May 2011, 09:30 last edited by
    #1

    Greeting Qt Devs,

    I've recently built my own ScrollArea for desktop based Qt Quick applications.
    It's supposed to work with any Item.

    At one point I wanted to insert a ListView inside of it. It inherits from Flickable which already includes scrolling capabilities. So i put interactive to off and forced the ListView height to its contentHeight.

    All was working well until I got a list of 5000 items. The performance turned out to be bad. I guess ListView performs optimizations depending on its size.

    Anyone got an idea on how I could insert a ListView in my generic ScrollArea and make it perform well ?

    Thanks.

    B.A.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on 30 May 2011, 20:24 last edited by
      #2

      Hi, since you already saw my blog post I guess you saw my reply already. But for others with the same issue, I would like to point out that this performance issue does no longer seem to affect builds of 4.8 and 5.0. (http://labs.qt.nokia.com/2011/05/26/table-view-with-qt-quick/ ) for context.

      [[Fixed URL, Tobias]]

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bunjee
        wrote on 30 May 2011, 22:51 last edited by
        #3

        Hey Jens,

        I've seen your 1 million items video.

        Day and night compared to 4.7.x. Looking forward to try 4.8 when it's in RC state.

        Thanks.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on 31 May 2011, 05:07 last edited by
          #4

          Hi,

          Note that forcing the ListView height to its contentHeight will cause all the list items to be instantiated (ListView typically instantiates items "on demand" when they enter the viewport).

          We've talked about making the architecture more generic (so that e.g. the item creation algorithm is more independent of the layout algorithm) and done some research in that direction, but I don't know when/if that will make it into a shipping Qt Quick version.

          Regards,
          Michael

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bunjee
            wrote on 31 May 2011, 09:49 last edited by
            #5

            bq. Note that forcing the ListView height to its contentHeight will cause all the list items to be instantiated (ListView typically instantiates items “on demand” when they enter the viewport).

            Yeah that's why I'm trying to cope with contentY and contentHeight to prevent everything being displayed.

            But I've just been linked to this: http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html#positionViewAtBeginning-method

            bq. Removing items from the start of the list does not cause all other items to be repositioned.

            @Jens, I'm not sure how to implement a QML ScrollBar correctly. When removing the first item contentY is "screwed". My ScrollBar depends on contentY.

            I think that this ( http://labs.qt.nokia.com/2011/05/26/table-view-with-qt-quick/ ) implementation also relies on a contentY. Do you confirm ?

            PS: the only workaround I found is calling reset after beginRemoveRows and beginMoveRows in my model. But I guess that's not very pretty.

            Thanks.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jens
              wrote on 1 Jun 2011, 06:10 last edited by
              #6

              bunjee. Yes I can confirm that my TableView implementation probably has the same issue with contentY that you describe as it works at the same level. Are there any other issues you have found with your scrollbar solution so far?

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bunjee
                wrote on 1 Jun 2011, 12:07 last edited by
                #7

                Looks like someone has pointed it out already: http://bugreports.qt.nokia.com/browse/QTBUG-10130

                Well the other issue I have is related to the dragging of the ScrollBar handle.

                It's a little tricky to describe:

                1. Pressing the left mouse button over the ScrollBar handle.
                2. Move the cursor out of the ScrollBar's MouseArea without scrolling the view.
                3. Try to scroll the view from outside the MouseArea.
                4. Nothing happens.

                This is related to MouseArea.

                On desktop applications it actually scrolls.

                Aside from Scrollbars and Contextual dialogs I have to say I get satisfying results. Not to mention I can leverage all the QML goodness for transitions and animations.

                I'm also reusing a lot of your QML components and the desktop module you provide on Git.

                B.A.

                1 Reply Last reply
                0

                1/7

                30 May 2011, 09:30

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved