Results 1 to 2 of 2

Thread: QTreeView: make root decoration appear on visual column 0

  1. #1
    Join Date
    Jun 2008
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Wiki edits
    1

    Default QTreeView: make root decoration appear on visual column 0

    This is something thats always bothered me about the hierarchical views.

    If you have view.setRootIsDecorated(true) set, the hierarchy of the model is represented by indenting the first column and adding dashed lines (like in all tree views).

    The problem occurs when you re-order the columns. If you move the very first column over it still displays the root decoration (even though it's no longer the column farthest to the left). I'd like it so that whichever column is displayed as the first column shows the root decoration/indentation.

    How can I go about doing this?

    Is this because its using the logical index instead of the visual index? Or is there a decoration role I can change in my model to do this?

    Thanks,

    Matt

  2. #2
    Join Date
    Jun 2008
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Wiki edits
    1

    Default Re: QTreeView: make root decoration appear on visual column 0

    I looked at the Qt source and it hard codes the root decoration to logicalIndex 0 meaning you would have to customize your model to be able to re-order the logical indicies of the header data.

    so view.model().headerData(0) is always going to show the root decoration.

Similar Threads

  1. 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
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

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.