> 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

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to