summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoawindow.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-12 15:33:13 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-13 16:52:01 +0000
commitc79710a1819d906bbcf98e3fa2a1133e5c5cb66e (patch)
treecf7ff8e4c4de051ca9d242817e2747b65c409fff /src/plugins/platforms/cocoa/qcocoawindow.mm
parent2f505b79a49bdf5ba8d084e13ab339bcf956c849 (diff)
macOS: Remove QNSView member m_window in favor of going via m_platformWindow
The two should never be out of sync, but by having them as separate members we risk that they do. By going though m_platformWindow for QWindow access, it's also more clear in the callsites that we're dealing with a QWindow instead of a NSWindow, as referenced though self.window. Finally, removing the member slims down memory use of a QNSView, however small. Change-Id: Iec96cebf813fae82d3af339331781419f234c28b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 6700bc28a9..4be1917f2d 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -388,7 +388,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
if (tlw->type() == Qt::ForeignWindow) {
m_view = (NSView *)WId(tlw->property("_q_foreignWinId").value<WId>());
} else {
- m_view = [[QNSView alloc] initWithQWindow:tlw platformWindow:this];
+ m_view = [[QNSView alloc] initWithCocoaWindow:this];
// Enable high-dpi OpenGL for retina displays. Enabling has the side
// effect that Cocoa will start calling glViewport(0, 0, width, height),
// overriding any glViewport calls in application code. This is usually not a