0

I am trying to use Qtreewidget as listview (like in C#) to display some data. As seen on the image below, while new datas displayed during the runtime, the widget doesn't focus on the last entry.That is what I want but couldn't find a method to make it focus on the last entry. In other words, I want it to be scrolled down to the last entry. Is there any way to do it or do I have to use something another to handle this ?

Thanks in advance.

enter image description here

Horizon1710
  • 792
  • 10
  • 28
  • 1
    Have you tried using [scrollToItem](https://qt-project.org/doc/qt-4.8/qtreewidget.html#scrollToItem)? That seems like the best candidate, and it's also a slot, so you could just connect it to the appropriate signal. – Xavier Holt Jul 15 '12 at 21:01
  • Thanks Xavier, I didnt know that these methods were exist. scrollToItem worked. Thanks alot. – Horizon1710 Jul 15 '12 at 21:20

1 Answers1

0

Maybe this code will helps you:

QTreeWidget *mytree = new QTreeWidget(this);
...
mytree->scrollToBottom();