QML ListView + QAbstractListModel
-
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.
-
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 -
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.
-
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