Solved How to show last delegates in ListView instead of first
-
Hi!
How to show last delegates in ListView instead of first?
-
hi @Mihaill
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 ApplicationWindow { id: root width: 800 height: 600 visible: true property var _model : ["a","b","c","d","e","f"] // _model.reverse() ListView { width: 180; height: 200 id:l model:_model delegate: Text { text: _model[ (_model.length-1) - index] //modelData } } }
you can also reverse the model before setting
-
You can play with
verticalLayoutDirection
property ofListView
. In your case it should be set toListView.BottomToTop
. -
I use:
verticalLayoutDirection: ListView.BottomToTop
but the start of the screen comes from the bottom (first) delegates of the model. I have to show the last delegates.
-
Or you can use
positionViewAtEnd
andpositionViewAtIndex
methods of ListView.