Results 1 to 11 of 11

Thread: Simple way to expand all nodes on a QTreeView?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    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: Simple way to expand all nodes on a QTreeView?

    This might not be the most efficient way..
    Qt Code:
    1. QModelIndexList indexes = model->match(model->index(0,0), Qt::DisplayRole, "*", -1, Qt::MatchWildcard|Qt::MatchRecursive);
    2. foreach (QModelIndex index, indexes)
    3. tree->expand(index);
    To copy to clipboard, switch view to plain text mode 

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

    cboles (16th March 2006)

Similar Threads

  1. Replies: 1
    Last Post: 28th February 2007, 08:34
  2. [QT4] QTreeView and expandable nodes
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2006, 16:52

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
  •  
Qt is a trademark of The Qt Company.