summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoabackingstore.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-05 21:56:58 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-10 16:06:41 +0000
commitf835b5aa9cba2665423e6e96a45d97c3c80296a5 (patch)
tree32f35432d9046302b799cb55a067195059e40580 /src/plugins/platforms/cocoa/qcocoabackingstore.mm
parent1df4b2a3609d977cc8123f1f82e454d0333287d4 (diff)
macOS: Get rid of m_qtView member in QCocoaWindow that aliased m_view
The member was mirroring m_view in all cases except for foreign windows. Instead of a member we now check window()->type() != Qt::ForeignWindow, which is more explicit, especially for people not normally working on the macOS platform. To call methods that are only implemented for our QNSView subclass, a new qnsview_cast() function has been introduced. Change-Id: I0a2cfe1a5e4502250c17e1c3ebdce19e9ee5e572 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoabackingstore.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index af5418315c..a74995319b 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -40,6 +40,7 @@
#include "qcocoabackingstore.h"
#include "qcocoawindow.h"
+#include "qcocoahelpers.h"
QT_BEGIN_NAMESPACE
@@ -51,7 +52,7 @@ QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
QCocoaBackingStore::~QCocoaBackingStore()
{
if (QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window()->handle()))
- [cocoaWindow->m_qtView clearBackingStore:this];
+ [qnsview_cast(cocoaWindow->view()) clearBackingStore:this];
}
QImage::Format QCocoaBackingStore::format() const
@@ -68,7 +69,7 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion &region, const QPo
return;
if (QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle()))
- [cocoaWindow->m_qtView flushBackingStore:this region:region offset:offset];
+ [qnsview_cast(cocoaWindow->view()) flushBackingStore:this region:region offset:offset];
}
QT_END_NAMESPACE