Results 1 to 3 of 3

Thread: QTreeWidgetItem - Is it possible to use 2nd column as root?

  1. #1
    Join Date
    Dec 2008
    Posts
    13

    Question QTreeWidgetItem - Is it possible to use 2nd column as root?

    Hi,

    Just getting to know Qt and doing it through PyQt. I'm set up through Eric4 and the latest version of PyQt4.

    I'm wondering if it's possible to use the 2nd column in a tree widget as the root, meaning that column gets the parent/child treatment with the root decoration. Basically I want to use the first column as one which holds the numerical value of the tree level and doesn't need to be indented with each sub-level.Then the second column shows the level breakdown. Like this:

    1 Parent
    1.1 Child
    1.2 Child

    I tried using the numerical value in the 2nd column, but it doesn't look good. I'm not very familiar yet with all of the models, so I may be going about this the wrong way. However I can't quite get this to look right.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTreeWidgetItem - Is it possible to use 2nd column as root?

    As far as I know the tree will always show the branches in the first column.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeWidgetItem - Is it possible to use 2nd column as root?

    I permofed root column in another column by subclassing QTreeView and swapping columns, but they looked ugly after that.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. QTreeView: make root decoration appear on visual column 0
    By chezifresh in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2008, 02:36
  2. Hide qtreewidgetitem root
    By altVis in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2008, 11:24
  3. Qt 4.2.2 and SuSE Linux 9.3
    By Teuniz in forum Installation and Deployment
    Replies: 15
    Last Post: 26th February 2007, 12:21
  4. 4.1.4 built from source, qmake fails with Hello World
    By Mookie in forum Installation and Deployment
    Replies: 6
    Last Post: 27th June 2006, 23:13
  5. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00

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.