×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    4

    Match QStyleItemDelegate with phone theme

    Hello!

    I'm creating a custom delegate for my ListWidget because I need to show an icon and 3 or four lines of text. I managed to do it but my problem right now is that when an item is selected the background is blue because of this code

    Code:
     if(option.state & QStyle::State_Selected){
              painter->fillRect(option.rect, option.palette.color(QPalette::Highlight));
    }
    I would like that the current selected item has a frame around it as it's by default with other ListWidget without delegate (the frame comes from the cellphone theme as in the first image)

    Here is an image with the frame


    And other with the background blue


    Thank you for your help.
    Last edited by luisr2003; 2010-07-25 at 14:07.

  2. #2
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Match QStyleItemDelegate with phone theme

    One way around this issue would to be to define your own QStyle that uses QS60Style as a base. Just re-implement CE_ItemViewItem drawing so that it is otherwise same as in QS60Style, but it just doesn't draw your delegate text/icon/etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •