Results 1 to 4 of 4

Thread: QTreeWidget - locating items in viewport

  1. #1
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QTreeWidget - locating items in viewport

    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?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget - locating items in viewport

    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.
    J-P Nurmi

  3. #3
    Join Date
    Aug 2006
    Posts
    77
    Thanks
    14
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeWidget - locating items in viewport

    But how to know which indexes are currently visible on the viewport?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget - locating items in viewport

    Oh, for that you could use geometrical functions of the viewport and then QTreeWidget::itemAt(QPoint). May I ask what do you intend to do, anyway?
    J-P Nurmi

Similar Threads

  1. Removing items properly from qtreewidget item
    By Djony in forum Qt Programming
    Replies: 6
    Last Post: 21st November 2006, 12:20

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.