diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-22 09:40:08 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-22 12:30:13 +0000 |
commit | 4cedbffb7e3612ec7eeb99957d80a010db77fa6b (patch) | |
tree | 100d8c2572a83165e922cf2b87bf6cd1dcf305e8 | |
parent | f84228106e5302d68b51736ca69a6ca9ed98a869 (diff) |
View3D: handle the rare but possible source change correctly
The value of the source property (the layer name or id) can change at
any time, in order to show another layer in the View3D. While this will
probably be used rarely in practice, we need to handle it correctly by
making sure the view-layer pairs are regenerated and pushed to the
renderer.
Change-Id: If21e1f43c0f08e8d7a6cb1d7f58e8db24f89af61
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r-- | src/imports/studio3d/q3dsstudio3ditem.cpp | 8 | ||||
-rw-r--r-- | src/imports/studio3d/q3dsstudio3ditem_p.h | 1 | ||||
-rw-r--r-- | src/imports/studio3d/q3dsstudio3dview.cpp | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/imports/studio3d/q3dsstudio3ditem.cpp b/src/imports/studio3d/q3dsstudio3ditem.cpp index 32a7407..25a4d8c 100644 --- a/src/imports/studio3d/q3dsstudio3ditem.cpp +++ b/src/imports/studio3d/q3dsstudio3ditem.cpp @@ -861,4 +861,12 @@ void Q3DSStudio3DItem::handleViewGeometryChange(Q3DSStudio3DView *view, const QS } } +void Q3DSStudio3DItem::handleViewSourceChange(Q3DSStudio3DView *view) +{ + Q_UNUSED(view); + + m_pendingViewSend = true; + update(); +} + QT_END_NAMESPACE diff --git a/src/imports/studio3d/q3dsstudio3ditem_p.h b/src/imports/studio3d/q3dsstudio3ditem_p.h index 9836ff5..737788a 100644 --- a/src/imports/studio3d/q3dsstudio3ditem_p.h +++ b/src/imports/studio3d/q3dsstudio3ditem_p.h @@ -85,6 +85,7 @@ public: void registerView(Q3DSStudio3DView *view); void unregisterView(Q3DSStudio3DView *view); void handleViewGeometryChange(Q3DSStudio3DView *view, const QSize &size); + void handleViewSourceChange(Q3DSStudio3DView *view); Q3DSEngine *engine() const { return m_engine; } diff --git a/src/imports/studio3d/q3dsstudio3dview.cpp b/src/imports/studio3d/q3dsstudio3dview.cpp index a965cc9..961b265 100644 --- a/src/imports/studio3d/q3dsstudio3dview.cpp +++ b/src/imports/studio3d/q3dsstudio3dview.cpp @@ -304,6 +304,10 @@ void Q3DSStudio3DView::setSource(const QString &s) return; m_source = s; + + if (m_engine) + m_engine->handleViewSourceChange(this); + emit sourceChanged(); if (window()) window()->update(); |