aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2021-12-07 14:47:31 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2021-12-07 12:57:42 +0000
commita4c2f2fb8c0020c9ee9c569ef0bbf5588d87304c (patch)
treee2c4f34f4db0e6c5273c2d3eca24df2f7fd61e2f /share
parentc22c22c3d61376cca29e12824679fdcaf9309c1f (diff)
QmlDesigner: Fix Qt5 compilation
QQuick3DViewport::pickAll was introduced in Qt 6.2. Checking against version 6.2.1 because that's when the global picking API was taken into use in QmlDesigner. Change-Id: Id69ff9d958da89ba9e043dfb082a99f640884a4e Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp
index 4182dcadf1..a4e950b238 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp
@@ -898,7 +898,12 @@ bool MouseArea3D::eventFilter(QObject *, QEvent *event)
// a problem
onCircle = false;
if (m_pickNode) {
- // We need to pick all as various other geometries can often be the first
+#if QT_VERSION < QT_VERSION_CHECK(6, 2, 1)
+ QQuick3DPickResult pr = m_view3D->pick(float(mousePos.x()), float(mousePos.y()));
+ pickSuccess = pr.objectHit() == m_pickNode;
+#else
+ // With the introduction of global picking API,
+ // we need to pick all as various other geometries can often be the first
// pick result, such as camera frustum or light geometry
const QList<QQuick3DPickResult> results = m_view3D->pickAll(float(mousePos.x()),
float(mousePos.y()));
@@ -908,6 +913,7 @@ bool MouseArea3D::eventFilter(QObject *, QEvent *event)
break;
}
}
+#endif
}
}
}