Qt-interest Archive, September 2007
Using QStyle::drawItemText to draw shaded text
Message 1 in thread
Hello all !
I'm currently pondering on a solution to use the mentioned function override to draw shaded text.
Has anyone else done this before ? Is it doable ?
Is QStyle::drawItemText() called for QLabels, QPushButtons etc ? Or just for specific controls ? Or is it
called for all possible text, including, e.g. list view items ?
Best Regards,
Antti Keskinen
--
[ signature omitted ]
Message 2 in thread
On fredag den 7. September 2007, Antti Keskinen wrote:
> Hello all !
>
> I'm currently pondering on a solution to use the mentioned function
> override to draw shaded text. Has anyone else done this before ? Is it
> doable ?
>
> Is QStyle::drawItemText() called for QLabels, QPushButtons etc ? Or just
> for specific controls ? Or is it called for all possible text, including,
> e.g. list view items ?
A lot of the widgets have a paintEvent that just call the current QStyle paint
method - this is IMHO the way they should all be. But some have more involved
paint events.
Some of the styles use their own private functions for drawing text, bevel
boxes etc. so you will have to check what the styles do to the painting.
There is no generic answer for this. You have to check the source code of the
classes involved.
Bo.
--
[ signature omitted ]