summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-31 10:09:49 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-31 10:09:49 (GMT)
commit255cf972a07f95bbedab752969d2842e435d5c9a (patch)
tree9198362a53cbc18f0bd8ee274307654e72121658 /src/gui/kernel
parent4567766cb696d9900c628fe19a174a42570eed5c (diff)
parent5cdafc956f6f2e18012b31d68851150d89d7e577 (diff)
downloadQt-255cf972a07f95bbedab752969d2842e435d5c9a.zip
Qt-255cf972a07f95bbedab752969d2842e435d5c9a.tar.gz
Qt-255cf972a07f95bbedab752969d2842e435d5c9a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Cocoa: remove 'double' content view from window Revert the change in applicationShouldTerminate().
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm1
-rw-r--r--src/gui/kernel/qwidget_mac.mm33
2 files changed, 15 insertions, 19 deletions
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 5dcf613..7a9dc70 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -196,7 +196,6 @@ static void cleanupCocoaApplicationDelegate()
qAppInstance()->quit();
startedQuit = false;
}
- return NSTerminateNow;
}
if (qtPrivate->threadData->eventLoops.size() == 0) {
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index f12c956..40c5dad 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -237,6 +237,8 @@ static NSDrawer *qt_mac_drawer_for(const QWidget *widget)
static void qt_mac_destructView(OSViewRef view)
{
#ifdef QT_MAC_USE_COCOA
+ if ([[view window] contentView] == view)
+ [[view window] setContentView:0];
[view removeFromSuperview];
[view release];
#else
@@ -2285,28 +2287,23 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin
Q_UNUSED(dialog);
data.fstrut_dirty = true; // when we create a toplevel widget, the frame strut should be dirty
+
OSViewRef nsview = (OSViewRef)data.winid;
- OSViewRef window_contentview = qt_mac_get_contentview_for(windowRef);
if (!nsview) {
- nsview = qt_mac_create_widget(q, this, window_contentview);
+ nsview = qt_mac_create_widget(q, this, 0);
setWinId(WId(nsview));
- } else {
- [window_contentview addSubview:nsview];
- }
- if (nsview) {
- NSRect bounds = [window_contentview bounds];
- [nsview setFrame:bounds];
- [nsview setHidden:NO];
- if (q->testAttribute(Qt::WA_DropSiteRegistered))
- registerDropSite(true);
- transferChildren();
-
- // Tell Cocoa explicit that we wan't the view to receive key events
- // (regardless of focus policy) because this is how it works on other
- // platforms (and in the carbon port):
- if (!qApp->focusWidget())
- [windowRef makeFirstResponder:nsview];
}
+ [windowRef setContentView:nsview];
+ [nsview setHidden:NO];
+ if (q->testAttribute(Qt::WA_DropSiteRegistered))
+ registerDropSite(true);
+ transferChildren();
+
+ // Tell Cocoa explicit that we wan't the view to receive key events
+ // (regardless of focus policy) because this is how it works on other
+ // platforms (and in the carbon port):
+ if (!qApp->focusWidget())
+ [windowRef makeFirstResponder:nsview];
if (topExtra->posFromMove) {
updateFrameStrut();