Results 1 to 2 of 2

Thread: QTreeWidget, first visible topLevelItem?

  1. #1
    Join Date
    Nov 2008
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTreeWidget, first visible topLevelItem?

    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.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTreeWidget, first visible topLevelItem?

    use QTreeWidget::itemAt() with coordinates like (5,5); or something like viewport()->height()-5 for the bottom item.

  3. The following user says thank you to caduel for this useful post:

    rtxleh (13th February 2009)

Similar Threads

  1. QTreeWidget child index
    By merlvingian in forum Newbie
    Replies: 3
    Last Post: 9th July 2015, 04:40
  2. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.