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>
This commit is contained in:
Miikka Heikkinen
2021-12-07 14:47:31 +02:00
parent c22c22c3d6
commit a4c2f2fb8c

View File

@@ -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
}
}
}