aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2021-12-13 12:16:48 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2021-12-14 15:27:01 +0000
commitd73be23c698d9d86a22f86f7b717dd5ec62c717f (patch)
tree0ca622a724ac1c062e8c2556c4f8b022746c7cb0
parent97a00e21e9bfe46441c2b024701d9a52d0e72305 (diff)
QmlDesigner: Make model used for instancing unpickable in 3D editor
The base model used for instancing is hidden at render time, so it should not be pickable in 3D editor. Fixes: QDS-5100 Change-Id: I7c58bd8e7e5c9bfbe75dbaff67c0fd99793ad610 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp
index 4d6c87a901..27302c374b 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp
@@ -360,6 +360,14 @@ bool GeneralHelper::isPickable(QQuick3DNode *node) const
if (!node)
return false;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ // Instancing doesn't hide child nodes, so only check for instancing on the requested node
+ if (auto model = qobject_cast<QQuick3DModel *>(node)) {
+ if (model->instancing())
+ return false;
+ }
+#endif
+
QQuick3DNode *n = node;
while (n) {
if (!n->visible() || isLocked(n) || isHidden(n))