cocoa: avoid sending windowNotification to a non-QNSView
Then it's possible to embed native cocoa widgets without crashing. Task-number: QTBUG-35629 Change-Id: Ic212c36178282b4d090c6ce0470012adc8e0c2bb Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
443bdb5042
commit
8fa6cb83c6
@ -942,10 +942,11 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
|
||||
[window setReleasedWhenClosed : NO];
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:m_contentView
|
||||
selector:@selector(windowNotification:)
|
||||
name:nil // Get all notifications
|
||||
object:m_nsWindow];
|
||||
if (m_qtView)
|
||||
[[NSNotificationCenter defaultCenter] addObserver:m_qtView
|
||||
selector:@selector(windowNotification:)
|
||||
name:nil // Get all notifications
|
||||
object:m_nsWindow];
|
||||
|
||||
[m_contentView setPostsFrameChangedNotifications: NO];
|
||||
[window setContentView:m_contentView];
|
||||
|
Loading…
Reference in New Issue
Block a user