Results 1 to 8 of 8

Thread: [SOLVED] QTreeView drawing selection with icons

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany - Mannheim
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [SOLVED] QTreeView drawing selection with icons

    Hi all,

    I'm trying to display 3 icons in the first 3 columns of a QTreeView. I did this by creating a model and returning a QIcon in the DecorationRole of the data function (the icon depends on the data of the item). This works quite ok but when selecting a row the selection looks quite ugly imo (as you can see in the first pic I attached). Because of the icons are placed very close to each other the selection looks more like a separator than a selection and I'm looking for a solution like in the second pic attached (taken from eMule) where the selection surrounds the icon.

    The problem I'm facing now is that I don't really know where to start.

    I think either my approach to use the decoration is not that good and drawing the icon in another way (but which one ?) would solve ths problem automatically ...

    or

    I have to reimplement the QTreeView class and handle drawing the selection by myself. But also here I'm not really sure where to start.

    any ideas about this ?
    Attached Images Attached Images
    Last edited by Timewarp; 22nd January 2006 at 13:27.

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.