Results 1 to 2 of 2

Thread: QTreeView & setRootIndex

  1. #1

    Default QTreeView & setRootIndex

    Hi,

    I have the following hierarchic data, populated using a model:
    .Root
    ...Parent1
    ...Parent2
    ...Parent3
    ......Child1
    ......Child2

    and I need to have the QTreeView display the following:
    Parent3
    ...Child1
    ...Child2

    using treeView->setRootIndex(Parent3), will only show the children.

    So, I suppose I need to use a proxy model and then filter the items, but how I could do that?


    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QTreeView & setRootIndex

    Did you set the view to show the root item?

Similar Threads

  1. Help ...QTreeView
    By Raymond in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2009, 09:18
  2. QTreeView. Qt.4.4.1
    By janEUcitzen in forum Qt Programming
    Replies: 1
    Last Post: 15th November 2008, 08:53
  3. Replies: 4
    Last Post: 16th August 2008, 02:42
  4. use QTreeView
    By totosugito in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2008, 09:33
  5. QTableView row height via delegate and setRootIndex
    By pmaktieh.sirhc in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2007, 19:06

Tags for this Thread

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.