[Development] QPA / QWindow / QPainter

Martin Koller kollix at aon.at
Sat Mar 8 17:10:47 CET 2014


On Friday 07 March 2014 14:56:04 Thiago Macieira wrote:
> Em sex 07 mar 2014, às 22:41:35, Martin Koller escreveu:
> > I'm implementing a QPA plugin (now with 5.3 snapshot) and there's something
> > I do not understand: When I use native widgets, every widget creates a
> > QPlatformWindow, but only a toplevel window creates a
> > QPlatformBackingStore, which is the class which delivers the paintDevice
> > implementation.
> > 
> > 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 ?
> 
> By "native widgets", do you mean "using one native window per widget", the 
> opposite of the "alien" project?

yes. I'm talking about
widget->setAttribute(Qt::WA_NativeWindow);
widget->setAttribute(Qt::WA_DontCreateNativeAncestors);

> Are you even sure that mode of operation even works in Qt 5?

Huh ?
It's still documented in Qt5
http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#native-widgets-vs-alien-widgets
and QWidget still has the documented methods (effectiveWinId(), nativeParentWidget())

> During the QPA 
> port of 5.0, we might have lost that ability and it shows in the API you've 
> found.

Do you find any trace of information that it's discontinued ?

> In any case, each non-top-level QWidget has a link to the top level window 
> (TLW) it's connected to and stores state there.

Yes, QWidget has windowHandle() if you mean that. But that does not answer my question.
In the QPA API there is no QWidget pointer AFAIK.
In Qt4's QPA there was no QWindow* but all with QWidget*, so I did know which QWidget
is currently painted.
But how can I know in Qt5 ?

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\                        - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at



More information about the Development mailing list