[Qt-interest] drawBackground() in QStyledItemDelegate?

Frank Mertens frank at cyblogic.de
Thu Oct 14 09:39:38 CEST 2010


On 10/13/2010 11:18 PM, NoRulez wrote:
> Hello,
>
> I could not find drawBackground() in QStyledItemDelegate, only in QItemDelegate. How can I use similar functions in QStyledItemDelegate like in QItemDelegate?
>
> Thanks in advance
>
> Best Regards
> NoRulez

If I remember right, you were supposed to use QStyle::drawControl().
Eventually setting QStyleOptionViewItemV4::text to "" in-before will allow
rendering background in the default way.
I just popped up the docs myself (similar issue to code around today;).
See: QStyledItemDelegate::paint(), which gives quite some good hints.



More information about the Qt-interest-old mailing list