Cocoa: Properly set QNSView's geometry when it's a subview

Task-number: QTBUG-26960
Change-Id: Ib8ca76572c868305f378d22c21d13511b4999244
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Gabriel de Dietrich 2012-11-22 15:56:48 +01:00 committed by The Qt Project
parent aba0e53db9
commit 127c30cbef

View File

@ -637,6 +637,9 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
// Child windows have no NSWindow, link the NSViews instead.
const QCocoaWindow *parentCococaWindow = static_cast<const QCocoaWindow *>(parentWindow);
[parentCococaWindow->m_contentView addSubview : m_contentView];
QRect rect = window()->geometry();
NSRect frame = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height());
[m_contentView setFrame:frame];
}
}