macOS: Remove workaround when setting view as content view

abde2a59c6 introduced this code on the basis that setContentView
does not remove the view from its superview, but disassembly of
AppKit shows that it does. Since commit 52767b8ee7 we also
ensure that the previous NSWindow has its contentView property
cleared, so this workaround is no longer needed.

Task-number: QTBUG-39628
Change-Id: I21e179263d006f3af1f8a55e9e2f7e8eeab2a632
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
Tor Arne Vestbø 2017-05-19 12:25:38 +02:00
parent 5336e061ec
commit 1051abc480

View File

@ -1655,11 +1655,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Move view to new NSWindow if needed // Move view to new NSWindow if needed
if (newWindow) { if (newWindow) {
[m_view setPostsFrameChangedNotifications:NO]; [m_view setPostsFrameChangedNotifications:NO];
[m_view retain];
if (m_view.superview) // m_view comes from another NSWindow
[m_view removeFromSuperview];
[newWindow setContentView:m_view]; [newWindow setContentView:m_view];
[m_view release];
[m_view setPostsFrameChangedNotifications:YES]; [m_view setPostsFrameChangedNotifications:YES];
m_nsWindow = newWindow; m_nsWindow = newWindow;