diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-11-13 23:23:41 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-11-16 08:43:33 (GMT) |
commit | d215ecd857be9eedee03703153ef2509c01b4811 (patch) | |
tree | 79b8dec6fffccf45bc9abf04a9546f4846c69240 /src | |
parent | 671d1590e5b7166dd4473cef70644988bf71e43d (diff) | |
download | Qt-d215ecd857be9eedee03703153ef2509c01b4811.zip Qt-d215ecd857be9eedee03703153ef2509c01b4811.tar.gz Qt-d215ecd857be9eedee03703153ef2509c01b4811.tar.bz2 |
Designer crashes in Mac Cocoa port.
When we reparent a widget, it has to be removed from the old view before
it is added to the new one. Otherwise this can cause the old view to
have an invalid first responder, causing crash.
Task-number: QTBUG-5327
Reviewed-by: Denis
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 75f9a59..71f0077 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2673,7 +2673,10 @@ void QWidgetPrivate::transferChildren() // site disabled until it is part of the new hierarchy. bool oldRegistered = w->testAttribute(Qt::WA_DropSiteRegistered); w->setAttribute(Qt::WA_DropSiteRegistered, false); + [qt_mac_nativeview_for(w) retain]; + [qt_mac_nativeview_for(w) removeFromSuperview]; [qt_mac_nativeview_for(q) addSubview:qt_mac_nativeview_for(w)]; + [qt_mac_nativeview_for(w) release]; w->setAttribute(Qt::WA_DropSiteRegistered, oldRegistered); #endif } |