Results 1 to 4 of 4

Thread: QTreeView, setItemDelegateForColumn

  1. #1
    Join Date
    Jun 2006
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QTreeView, setItemDelegateForColumn

    ItemDelegate show icons in column 0.
    Is it possible for QTreeView, in parent index with column==0 to show - text, for child indexes - delegated icons.

  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: QTreeView, setItemDelegateForColumn

    As far as I understand what you mean - yes and you don't need a custom delegate for it, the default will do just fine provided that the model returns proper data for proper roles. It would be advised to explain what you mean though as I might have misunderstood you.

  3. #3
    Join Date
    Jun 2006
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView, setItemDelegateForColumn

    tree has structure:
    -date
    ---info icons, other columns.
    Not problem to use DecorationRole to show one icon. But need to show few images

  4. #4
    Join Date
    Jun 2006
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView, setItemDelegateForColumn

    Solved, in paint for delegate analysing is parent == QModelIndex(). If so - drawText, in other case - drawing pictures.

Similar Threads

  1. QTreeView repaint
    By graeme in forum Qt Programming
    Replies: 17
    Last Post: 13th March 2012, 13:27
  2. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 21:22
  3. QTreeView: Holding a line on screen
    By gri in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 11:42
  4. background image in QTreeView
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 06:25
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.