PDA

View Full Version : QTreeWidget - locating items in viewport



kemp
14th December 2007, 14:24
Hi!

I have a QTreeWidget with only toplevelItems. Is there a way to get the first visible
item and the last visible item on the viewport?

jpn
14th December 2007, 14:26
Hi

Yes, QTreeWidget has a method that gives the "top level item" at certain index. There is also a method to get the total count of top level items.

kemp
14th December 2007, 14:31
But how to know which indexes are currently visible on the viewport?

jpn
14th December 2007, 15:18
Oh, for that you could use geometrical functions (http://doc.trolltech.com/latest/geometry.html) of the viewport and then QTreeWidget::itemAt(QPoint). May I ask what do you intend to do, anyway?