[Development] QPA / QWindow / QPainter

Paul Olav Tvete paul.tvete at digia.com
Mon Mar 10 10:31:32 CET 2014


On Monday 10 March 2014 09:20:14 Agocs Laszlo wrote:
> > > Question: when a QWidget now creates a QPainter on it, how does my QPA
> > > plugin know onto which QWindow it is currently acting, when there's only
> > > one paintDevice/one backing store ?

> As for the painting step, QPA has almost nothing to do with it: you merely
> provide a QPaintDevice, the rest is up to the widgets. The QPA plugin has
> no knowledge or interest in what's happening in there. The interesting part
> is the flush that happens afterwards, and in flush() you will of course
> know which QWindow is being flushed.

This functionality comes from early Qt 4 days, before non-native widgets were 
implemented. All widgets paint to the same backingstore, and then each widget 
gets its content from the part of the backingstore it covers.

This way we got the illusion of partially transparent widgets even if the 
underlying windowsystem did not support it. After non-native widgets (AKA 
"alien") were implemented, this feature is much less important, and we would 
probably not implement it like that today.

- Paul



More information about the Development mailing list