Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to scrolldown/scrollup the listview automatically whenever an item is added at the end /removed from listview?
-
Hi All,
How i can scroll down listview to the end to show last item (which present at below )whenever a new item is added.similarly whenever an item removed at the end how to scroll up.
-
@divaindie hi
see this methodspositionViewAtBeginning() positionViewAtEnd() positionViewAtIndex(int index, PositionMode mode)
-
i think this function positionViewAtIndex(int index, PositionMode mode) what iam searching for !!
-
Hi @divaindie ,
Whenever the new item is removed, you just set the contentY of listview to zero.
listview.contentY =0; //scroll up
listview.contentY =listview.height; //scroll down whenever item is added (just assign some positive value and see the reflection)And also you can use following methods
positionViewAtBeginning()
positionViewAtEnd()this code may help you to solve your problem.
-
thanks all for reply , i solved this with "positionViewAtIndex".