macOS: Remove unneeded argument to QCocoaWindow::recreateWindow()

The parent window is available through QPlatformWindow::parent().

Change-Id: I2436c001ec18f5abba99db3061acb0edcd8035a2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
bb10
Tor Arne Vestbø 2016-10-20 14:50:19 +02:00 committed by Timur Pocheptsov
parent be911de259
commit 1b8bc2c97f
2 changed files with 8 additions and 6 deletions

View File

@ -238,7 +238,7 @@ public:
static QPoint bottomLeftClippedByNSWindowOffsetStatic(QWindow *window);
QPoint bottomLeftClippedByNSWindowOffset() const;
protected:
void recreateWindow(const QPlatformWindow *parentWindow);
void recreateWindow();
QCocoaNSWindow *createNSWindow();
void setNSWindow(QCocoaNSWindow *window);

View File

@ -404,7 +404,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
[m_view setWantsLayer:enable];
}
setGeometry(tlw->geometry());
recreateWindow(QPlatformWindow::parent());
recreateWindow();
tlw->setGeometry(geometry());
if (tlw->isTopLevel())
setWindowIcon(tlw->icon());
@ -638,7 +638,7 @@ void QCocoaWindow::setVisible(bool visible)
if (visible) {
// We need to recreate if the modality has changed as the style mask will need updating
if (m_windowModality != window()->modality() || isNativeWindowTypeInconsistent())
recreateWindow(QPlatformWindow::parent());
recreateWindow();
// Register popup windows. The Cocoa platform plugin will forward mouse events
// to them and close them when needed.
@ -1156,7 +1156,7 @@ void QCocoaWindow::setParent(const QPlatformWindow *parentWindow)
// recreate the window for compatibility
bool unhideAfterRecreate = parentWindow && !m_viewIsToBeEmbedded && ![m_view isHidden];
recreateWindow(parentWindow);
recreateWindow();
if (unhideAfterRecreate)
[m_view setHidden:NO];
setCocoaGeometry(geometry());
@ -1262,8 +1262,10 @@ QCocoaGLContext *QCocoaWindow::currentContext() const
}
#endif
void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
void QCocoaWindow::recreateWindow()
{
const QPlatformWindow *parentWindow = QPlatformWindow::parent();
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindow" << window()
<< "parent" << (parentWindow ? parentWindow->window() : 0);
@ -1279,7 +1281,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
QWindow *parentQWindow = m_parentCocoaWindow->window();
if (!parentQWindow->property("_q_platform_MacUseNSWindow").toBool()) {
parentQWindow->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
m_parentCocoaWindow->recreateWindow(m_parentCocoaWindow->m_parentCocoaWindow);
m_parentCocoaWindow->recreateWindow();
}
}