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

QML ListView + QAbstractListModel

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 5.0k 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 last edited by
    #1

    Greetings Qt devs,

    I'm using a QML ListView and my own QAbstractListModel.

    When removing an item, the contentY is on 0.

    For some reason when removing the very first item the contentY is incremented to the item's size.

    I would like this contentY to stay on 0 no matter what.

    I'm not sure of the cause of this behavior, could this be a bug of 4.7 ?

    Thanks.

    B.A.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      As far as I know this behavior is intentional -- it allows the list to avoid having to reposition all the items. See http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html#positionViewAtBeginning-method for a note on this behavior.

      Regards,
      Michael

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bunjee
        wrote on last edited by
        #3

        That's a very surprising behavior.

        I'm not sure how to code my QML Scrollbar if the contentY is "broken".

        Currently as a workaround, I call reset() manually from my model. I'm not too happy about that :).

        B.A.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on last edited by
          #4

          Hi,

          The "visibleArea":http://doc.qt.nokia.com/4.7-snapshot/qml-flickable.html#visibleArea.xPosition-prop properties are usually what is recommended for scrollbars, but are read only (and useful only for scrollbars that are displayed, not for interactive scrollbars). "QTBUG-10130":http://bugreports.qt.nokia.com/browse/QTBUG-10130 is the task for this; hopefully others will have some suggestions for you in the meantime.

          Regards,
          Michael

          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