summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmainwindow.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2010-02-15 13:06:32 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2010-03-02 10:33:16 (GMT)
commit7366200d7600271c86144e70ae59ce77f39b2a16 (patch)
tree9460cd64d996dd03285e2ebcc14ed4f0ddcb802b /src/gui/widgets/qmainwindow.cpp
parent13f23b71cee682ccaaec455d72b1578afc2800ee (diff)
downloadQt-7366200d7600271c86144e70ae59ce77f39b2a16.zip
Qt-7366200d7600271c86144e70ae59ce77f39b2a16.tar.gz
Qt-7366200d7600271c86144e70ae59ce77f39b2a16.tar.bz2
Implement alien widgets on Mac/Cocoa.
This commit makes alien widgets opt in on a per-widget basis on Mac, set the Qt::WA_NativeWindow flag when creating the widget to enable. Setting this flag on widgets that have native child or sibling NSViews is not supported. The main use case for alien widgets on Mac is to improve performance for applications that have complex user interfaces. Qt can handle thousands of widgets per window, while Cocoa is designed to use a smaller number of NSViews in combination with NSCells and custom control implementations. This commit moves us in the direction of having a few main NSViews with "leaf" qwidgets implemented as a custom control.
Diffstat (limited to 'src/gui/widgets/qmainwindow.cpp')
-rw-r--r--src/gui/widgets/qmainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index 4620597..bdab6fb 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -1478,7 +1478,8 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
return;
// ### Disable the unified toolbar when using anything but the native graphics system.
- if (windowSurface())
+ // ### Disable when using alien widgets as well
+ if (windowSurface() || testAttribute(Qt::WA_NativeWindow) == false)
return;
d->useHIToolBar = set;