Results 1 to 6 of 6

Thread: look through a QTreeWidget

  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default look through a QTreeWidget

    Hello, i have a QTreeWidget and i want to look through all the QTreeWidgetItem housed in my QTreeWidget. Is there a way to know how many QTreeWidget i have in?
    Thx

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default

    Yes, you need a recursive solution. Search the forums, there are a couple of these solutions around.

    http://www.qtcentre.org/forum/f-qt-p...ight=recursive
    Last edited by wysota; 22nd December 2007 at 18:37.

  3. #3
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: look through a QTreeWidget

    I found this one
    http://www.qtcentre.org/forum/f-qt-p...data-7575.html
    but i have a QTreeWidget not a QTreeWidgetItem so i can't use the childCount() method, i'd like just to know the QTreeWidget size....
    thx

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: look through a QTreeWidget

    The size in what? pixels? Items?

  5. The following user says thank you to marcel for this useful post:

    mattia (20th December 2007)

  6. #5
    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: look through a QTreeWidget

    What about using QTreeWidget::findItems()? You could search for "*" and pass wildcard and recursive matching flags. Notice also QTreeWidgetItemIterator in case you want to iterate certain items.
    J-P Nurmi

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

    mattia (20th December 2007)

  8. #6
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: look through a QTreeWidget

    thx, the iterator is just rigth for me

Similar Threads

  1. QTreeWidget click
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 24th October 2007, 16:47
  2. Having trouble clearing a QTreeWidget.
    By Nyphel in forum Qt Programming
    Replies: 28
    Last Post: 10th October 2007, 15:33
  3. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  4. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07: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.