Commit 7c0f4b24 authored by Zeno Albisser's avatar Zeno Albisser
Browse files

Notify the NativeViewContainer when the QQuickNativeView is being destroyed.

Showing with 6 additions and 1 deletion
...@@ -65,6 +65,7 @@ public: ...@@ -65,6 +65,7 @@ public:
{ {
if (m_isQQuick) { if (m_isQQuick) {
insert(new QQuickNativeView(renderWidgetHostView)); insert(new QQuickNativeView(renderWidgetHostView));
connect(m_currentQQuickNativeView, SIGNAL(destroyed(QObject*)), this, SLOT(destroyedNativeView(QObject*)));
return m_currentQQuickNativeView; return m_currentQQuickNativeView;
} }
...@@ -82,7 +83,6 @@ protected: ...@@ -82,7 +83,6 @@ protected:
void insert(QQuickNativeView* nativeView) void insert(QQuickNativeView* nativeView)
{ {
fprintf(stderr, "replace: %p with %p\n", m_currentQQuickNativeView, nativeView);
if (m_currentQQuickNativeView) if (m_currentQQuickNativeView)
m_currentQQuickNativeView->setParentItem(0); m_currentQQuickNativeView->setParentItem(0);
...@@ -101,6 +101,11 @@ public Q_SLOTS: ...@@ -101,6 +101,11 @@ public Q_SLOTS:
m_currentQQuickNativeView->resize(w, h); m_currentQQuickNativeView->resize(w, h);
} }
void destroyedNativeView(QObject* nativeView)
{
m_currentQQuickNativeView = 0;
}
private: private:
QObject* m_embeddable; QObject* m_embeddable;
QWidgetNativeView* m_currentQWidgetNativeView; QWidgetNativeView* m_currentQWidgetNativeView;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment