[Qt-interest] Qt::WA_NativeWindow
Ross Bencina
rossb-lists at audiomulch.com
Fri Jan 22 15:55:18 CET 2010
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/20100123/25c1f7f4/attachment.html
More information about the Qt-interest-old
mailing list