diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-05 21:56:58 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-10 16:06:41 +0000 |
commit | f835b5aa9cba2665423e6e96a45d97c3c80296a5 (patch) | |
tree | 32f35432d9046302b799cb55a067195059e40580 /src/plugins/platforms/cocoa/qcocoabackingstore.mm | |
parent | 1df4b2a3609d977cc8123f1f82e454d0333287d4 (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.mm | 5 |
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 ®ion, 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 |