Results 1 to 2 of 2

Thread: QTreeWidget and expandall() function

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeWidget and expandall() function

    I am using QT 4.3 and using the expandall() function to expand all of the
    items in a treewidget.
    I have setup a signal/slot for itemexpanded and this function does get
    called if I manually expand a tree node.
    I need this to selectively bold some of the tree items.

    I would like my function to be called for each expanded item as a result of
    my Expandall() call but that does not happen.

    How can I make the Expandall() generate the necessary tree item signals, or
    if that is not possible, what is
    the easiest way to iterate the tree items such that I can manually call my
    function for the necessary items?

    Many thanks!

    Mark

  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 Re: QTreeWidget and expandall() function

    See this post: http://www.qtcentre.org/forum/f-qt-p...data-7575.html

    You will have to modify that function(actually add something to it) and expand every item in the hierarchy that has children. Really easy to do. You just have to call setExpanded(true) for the item in question.

    You can use that function and pass as parameter the tree item that you want to be expanded. This will cause the item itself along with all its children to be expanded.

    Regards

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.