PDA

View Full Version : QTreeWidget, first visible topLevelItem?



rtxleh
12th February 2009, 10:11
Hi,

Assume a QTreeWidget with 1000 topLevelItem's, the user has scrolled some way down in the tree. How do i know:
1) Which topLevelItem index is the first one visible?
2) How many items are visible?

I.e. I am looking for the equivalent of Win32 ListView_GetTopIndex and ListView_GetCountPerPage.

Leo Havmøller.

caduel
12th February 2009, 12:19
use QTreeWidget::itemAt() with coordinates like (5,5); or something like viewport()->height()-5 for the bottom item.