Results 1 to 3 of 3

Thread: Get a certain item from a QTreeWidget

  1. #1
    Join Date
    Apr 2006
    Location
    New Zealand
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Get a certain item from a QTreeWidget

    Hi
    I've got a QTreeWidget representing a list with 3 columns. The list isn't hierarchical, means all the rows are top level items.
    I want my program to select/highlight a certain row in my list, for instance the 2nd one (index 1) . I'm struggeling to implement that. The method QTreeWidget::setCurrentItem would probably do that but requires a QTreeWidgetItem as a parameter, but how do I get this item that corresponds to my index.
    Any help is highly appreciated.
    Cheers
    MaCe

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

    Default Re: Get a certain item from a QTreeWidget

    J-P Nurmi

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

    mace (28th August 2006)

  4. #3
    Join Date
    Apr 2006
    Location
    New Zealand
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Get a certain item from a QTreeWidget

    Quote Originally Posted by jpn
    I feel a bit like a dork. Found all kind of function but some how missed the one I wanted. Lots of trees but no forest.

    Anyway thanks a lot for the very quick response.
    MaCe

Similar Threads

  1. QTreeWidget & QListWidget different selection
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 06:50
  2. QTreeWidget's Item Widgets
    By jpn in forum Qt Programming
    Replies: 11
    Last Post: 1st April 2006, 23:56
  3. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32
  4. insert Item to my QTreeWidget
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 28th February 2006, 15:42
  5. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

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.