[Interest] paintEvent
Konstantin Tokarev
annulen at yandex.ru
Wed Jan 29 11:48:59 CET 2014
29.01.2014, 14:43, "Igor Mironchik" <igor.mironchik at gmail.com>:
> Hi.
>
> I'm implementing AbstractScrollArea and ScrollArea for QtMWidgets library.
>
> Almost all have been done except painting scroll indicators.
>
> The problem is that that I can't draw on child widget. I installed event
> filter for the child widget, and in the filter I invoke paint method for
> scroll indicators. All is ok, but child's paint event become after event
> filter's paint event. And child's paint event paints on my scroll
> indicators.
>
> Is there any way to invoke child's pain event in filter method? I can't
> simple invoke child's paint event because this method is protected...
>
> Any adeas?!
>
You cannot neither paint on child widget, nor manipulate paintEvents' order.
There are 2 possibile ways:
1. Implement these widgets as one custom widget (best performance, more code).
For example, your scroll area can take rendering delegate with paint() method,
called in proper moment from your paintEvent() to draw contents.
2. Add 3rd widget on top of scroll area (worse performance, but simpler)
--
Regards,
Konstantin
More information about the Interest
mailing list