Frage

when i added an item in a qlistwiget and reaches the bottom. A scroll bar appears, how can i ensurevisible an item that was newly added from the qlistwidget? Or how can i get the focus to the last index?

War es hilfreich?

Lösung

QListWidget inherits from QAbstractItemView, which has the methods you are looking for:

Andere Tipps

After creating the new QListWidgetItem, pass it to QListWidget.scrollToItem to ensure that it becomes visible.

Note that scrollToItem also has a scroll hint parameter that allows fine-tuning of how the item is re-positioned in the list widget.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top