QListWidget automatically moves to the end of the list

I have QListWidgetone that has many elements added to it, however I want it to QListWidgetautomatically scroll to the last element every time a new element is added to it. Is it possible?

+3
source share
4 answers
+14
source

try the scrollTo method inherited from QAbstractItemView http://doc.qt.io/qt-5/qabstractitemview.html#scrollTo

0
source

Qt signal/slot:

connect(listWidget->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
        listWidget, SLOT(scrollToBottom()));

https://forum.qt.io/topic/1770/qlistwidget-auto-scroll/4

0

Source: https://habr.com/ru/post/1796046/


All Articles