Results 1 to 2 of 2

Thread: How to draw selection in delegate

  1. #1
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to draw selection in delegate

    Hi
    I've implemented a custom item delegate. It is working good; the only problem is that i still want the selection to be drawn by the style.
    I've looked into sources and seen that QStyledItemDelegate uses
    style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget);
    for its work.

    But having above line in my delegate's painter seems twice the work [given that everything else except selection is drawn by this custom delegate (btw QStyledItemDelegate is not enough for me)]. Do you have any better idea to draw *only* the selection for the item?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to draw selection in delegate

    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    yogeshm02 (26th May 2008)

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.