summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/data/qcustom3ditem.cpp
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2022-08-25 09:07:45 +0300
committerTomi Korpipaa <tomi.korpipaa@qt.io>2022-08-26 11:03:04 +0300
commit449f644df503dc409514cafd7b46ee8664e4d451 (patch)
tree3b5fdba3a3ffb6a3ae317f30ec5bacdadf083810 /src/datavisualization/data/qcustom3ditem.cpp
parenteae43d7f21b29a8d40e2f12f418efd7f9a35a43c (diff)
Do not crash if custom object load fails
There was no check for the existence of UVs or normals in an OBJ file. A check for those was added. Additionally a debug message was added in case model loading fails due to missing UVs or normals. Furthermore, we no more qFatal out when custom object loading fails. Pick-to: 6.2 6.4 Fixes: QTBUG-105398 Change-Id: Ie2742fb4307fe117e313cedf8111bc8f460f9c7b Reviewed-by: Sami Varanka <sami.varanka@qt.io> Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io> Reviewed-by: Dilek Akcay Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/datavisualization/data/qcustom3ditem.cpp')
-rw-r--r--src/datavisualization/data/qcustom3ditem.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/datavisualization/data/qcustom3ditem.cpp b/src/datavisualization/data/qcustom3ditem.cpp
index a9cfd5de..a657823c 100644
--- a/src/datavisualization/data/qcustom3ditem.cpp
+++ b/src/datavisualization/data/qcustom3ditem.cpp
@@ -32,7 +32,9 @@ QT_BEGIN_NAMESPACE
/*! \qmlproperty string Custom3DItem::meshFile
*
* The item mesh file name. The item in the file must be in Wavefront OBJ format and include
- * vertices, normals, and UVs. It also needs to be in triangles.
+ * vertices, normals, and UVs. It also needs to be in triangles. If the file is missing either
+ * normals or UVs, loading will fail with an error message to the console output and the item will
+ * not be rendered.
*/
/*! \qmlproperty string Custom3DItem::textureFile
@@ -177,6 +179,9 @@ QCustom3DItem::~QCustom3DItem()
*
* The item in the file must be in Wavefront OBJ format and include
* vertices, normals, and UVs. It also needs to be in triangles.
+ * If the file is missing either normals or UVs, loading will fail
+ * with an error message to the console output and the item will
+ * not be rendered.
*/
void QCustom3DItem::setMeshFile(const QString &meshFile)
{