Results 1 to 3 of 3

Thread: QTreeView select parent nodes

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeView select parent nodes

    I am using a QTreeView. I have three levels of nodes.

    1) I want to restrict the user to select/edit only the last level of Nodes
    2) When the user select a last level node, I want to highlight all its parents till root level
    3) When the user select a last level node, I want to programattically get entire string path from root to selected item (last level)

    Any sample code is appreciated. Thanks in advance

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QTreeView select parent nodes

    What is the model are you using? Standard/File/Custom...?
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeView select parent nodes

    I am using Standard Model.

Similar Threads

  1. Simple way to expand all nodes on a QTreeView?
    By cboles in forum Qt Programming
    Replies: 10
    Last Post: 12th April 2014, 16:54
  2. Mirror nodes in QTreeView - reuse of QStandardItem fail
    By muenalan in forum Qt Programming
    Replies: 0
    Last Post: 13th January 2011, 13:13
  3. Replies: 0
    Last Post: 11th January 2011, 12:31
  4. Replies: 1
    Last Post: 28th February 2007, 08:34
  5. [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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.