Results 1 to 5 of 5

Thread: Create Tree Structure

  1. #1
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Post Create Tree Structure

    i want to crate only onle label tree like structure. I want to expand all the item and don't want to allow to contract. As well as i dont want the tree widget header bar.
    I want to create the structure as it is shown in the Qt Centre, i.e. i attached in the attachement.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Create Tree Structure

    Start with a QTreeWidget or a QTreeView is you want to have model. Then start by hiding the header, and then work your way through the properties - preferably in Designer where you get immediate feedback.

  3. #3
    Join Date
    Jan 2008
    Location
    Forstinning, Germany
    Posts
    10
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Create Tree Structure

    For making the treeview/widget more static, use:
    Qt Code:
    1. view.setItemsExpandable(false);
    2. view.expandAll();
    To copy to clipboard, switch view to plain text mode 

    For making the header invisible, use:
    Qt Code:
    1. view.setHeaderHidden(true);
    To copy to clipboard, switch view to plain text mode 

    rtfm

  4. The following user says thank you to hwerglmir for this useful post:

    bismitapadhy (4th June 2009)

  5. #4
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Create Tree Structure

    Quote Originally Posted by e8johan View Post
    Start with a QTreeWidget or a QTreeView is you want to have model. Then start by hiding the header, and then work your way through the properties - preferably in Designer where you get immediate feedback.
    I am using qtreewidget and qtreewidgetItem, created tree structure as well able to hide the header,but i am not able to disable or hide the expandable option.Tell me which setting is helpful for this.

  6. #5
    Join Date
    Jan 2008
    Location
    Forstinning, Germany
    Posts
    10
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Create Tree Structure

    look one post above. "view" is your qtreewidget.

    Qt Code:
    1. view.setItemsExpandable(false);
    2. view.expandAll();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Treeview Structure
    By bismitapadhy in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2009, 13:44
  2. Preserving structure in QTreeView drag and drop
    By Tito Serenti in forum Qt Programming
    Replies: 1
    Last Post: 14th February 2009, 03:39
  3. how to create a tree with check on branch?
    By richardander in forum Qt Programming
    Replies: 3
    Last Post: 8th January 2009, 16:57
  4. creating a Tree
    By mickey in forum General Programming
    Replies: 0
    Last Post: 20th April 2008, 17:57
  5. Optimizing filterAcceptsRow() to filter a tree
    By vfernandez in forum Qt Programming
    Replies: 1
    Last Post: 4th January 2007, 12:50

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.