[Qt-interest] Qt::WA_NativeWindow

manish.s.sharma at nokia.com manish.s.sharma at nokia.com
Mon Jan 25 09:22:15 CET 2010


Hi Ross,

Got the idea. Thanks a lot for the information.

Regards,
Manish

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of ext Ross Bencina
Sent: Friday, January 22, 2010 8:25 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Qt::WA_NativeWindow

manish.s.sharma at nokia.com wrote:
>What is the use of Qt::WA_NativeWindow? Qt assistant doesn't give much info about the flag.

Most native window systems support the notion of composable subwindows (e.g. child HWNDs on Windows, HIViews on Carbon etc, incidentally, returned by QWidget::winId()). This is roughly equivalent to parent-child QWidgets -- but these days (since Qt4.1 I think) Qt uses an optimisation by default where it uses as few native window objects as possible and manages all of the parent-child stuff itself. So lots of QWidgets will share one HWND for example. This is generally more efficient as it allows things like a single screen double-buffer per top level widget. But sometimes you really need a child QWidget to also be a native HWND, HIView etc -- usually when integrating with non Qt code -- that's where Qt::WA_NativeWindow (and related flags) are useful.

In my app I use Qt::WA_NativeWindow when I need to provide a HIView or HWND as a container (parent) to a third-party plugin.

HTH

Ross.



===================================
Perform, Compose, Mangle
AudioMulch 2.0 modular audio software for PC and Mac
http://www.audiomulch.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100125/6161a5e5/attachment.html 


More information about the Qt-interest-old mailing list