On 11/27/2012 06:03 PM, Nurmi J-P wrote:
>> I am drawing a checkbox inside a custom delegate using
>> QStyle::drawPrimitive. I use this custom delegate to render items of a
>> QListView. Paint method of my custom delegate is as below,
>>
>>
>> void MytDelegate::paint(QPainter *painter,
>>              const QStyleOptionViewItem &option,
>>              const QModelIndex &index) const {
>>
>> QStyleOptionViewItem checkBoxStyle(option);
>>
>> // set checkBoxStyle.rect here
>>
>> checkBoxStyle.state = QStyle::State_On;
>
> This assignment overrides any state flags that were copied from 'option'. Use 
> bitwise OR instead:
>
> checkBoxStyle.state |= QStyle::State_On;
>
> --
> J-P Nurmi

Thank you very much!
That was the problem. Now it is working fine.

Regards,
-lijo
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to