path: root/src/plugins/platforms/cocoa/qcocoawindow.h
diff options
authorMorten Johan Sørvig <>2017-06-08 14:17:15 +0200
committerMorten Johan Sørvig <>2018-03-21 11:33:22 +0000
commit8efacb9d1e7cc3303e881f0a4e3818bb7ab27c17 (patch)
tree2ef644fdce6059408dfd7c4033f6a309510d8df2 /src/plugins/platforms/cocoa/qcocoawindow.h
parentcc920b4cddc170a7442d8fdfb53076c208a3d71e (diff)
Cocoa: Remove m_viewIsEmbedded and m_ViewIsToBeEmbedded
Implement QCocoaWindow::isEmbedded() which detects this property based on parent view and window type. This avoids having to use a setter function to set the state. The detection can’t handle all cases, but should be sufficient for our use case. Change-Id: I12a5b90b4e4a7e10714f7275ae001e99c9361e2c Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.h')
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index ec9fb444bd..9fa8ff9336 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -112,6 +112,7 @@ public:
void raise() override;
void lower() override;
bool isExposed() const override;
+ bool isEmbedded() const override;
bool isOpaque() const;
void propagateSizeHints() override;
void setOpacity(qreal level) override;
@@ -132,7 +133,7 @@ public:
NSView *view() const;
NSWindow *nativeWindow() const;
- void setEmbeddedInForeignView(bool subwindow);
+ void setEmbeddedInForeignView();
Q_NOTIFICATION_HANDLER(NSViewFrameDidChangeNotification) void viewDidChangeFrame();
Q_NOTIFICATION_HANDLER(NSViewGlobalFrameDidChangeNotification) void viewDidChangeGlobalFrame();
@@ -237,10 +238,6 @@ public: // for QNSView
NSView *m_view;
QCocoaNSWindow *m_nsWindow;
- // TODO merge to one variable if possible
- bool m_viewIsEmbedded; // true if the m_view is actually embedded in a "foreign" NSView hiearchy
- bool m_viewIsToBeEmbedded; // true if the m_view is intended to be embedded in a "foreign" NSView hiearchy
Qt::WindowStates m_lastReportedWindowState;
Qt::WindowModality m_windowModality;
QPointer<QWindow> m_enterLeaveTargetWindow;