summaryrefslogtreecommitdiffstats
path: root/src/plugins/geometryloaders/default/objgeometryloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ObjGeometryLoader: fix out-of-bounds accessesAurélien Brooke2023-06-121-1/+10
| | | | | | | | | | | | We were reading values before the beginning of the array. "Conditional jump or move depends on uninitialised value(s)" Check the value of lineSize before using it as an index. Fixes: QTBUG-97751 Pick-to: 6.5 6.6 Change-Id: I57c4f36973f3d5a6f9aecf4d22626af3e29f71f4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove qsizetype to int narrowing conversionsAurélien Brooke2022-12-211-2/+2
| | | | | | | | Change the variable type from int to qsizetype when receiving qsizetype values. Change-Id: I2adf71e1d2f26b1452fee28890c0f68300f54224 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-201-1/+1
| | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I1b3c7c4058726c55199fd8ba74b6d6890ad8dd93 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-06-221-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I8105424281eed871037fa6c463871ca8829876b5 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix missing includesVille Voutilainen2022-05-171-0/+1
| | | | | | | | | | | These popped up on a developer build of the newest dev branch. I don't know whether there's been header refactoring churn or whether the devs and CI use pch, but I certainly couldn't build without these fixes, on Linux with GCC 11. Pick-to: 6.3 6.2 Change-Id: Ic3529a33f4bc5c339b22c523d0be811ffb977c06 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Convert containers to use std::vectorMike Krus2020-12-011-1/+1
| | | | | Change-Id: Id1445c48761890836f965bee5c28df9b17e1fca4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix deprecated API usage and compile warningsMike Krus2020-11-201-1/+1
| | | | | | | | | - QVariant::Type deprecated, use QMetaType related APIs - QNodeId not used as reference in for loops (nop but really noisy) - some unused code Change-Id: I291219207fcd1ad0bf89533b4e2bb5fa47a353bb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix compilation with newer qtbaseFabian Kosmale2020-08-251-0/+1
| | | | | Change-Id: Iaba2780c2ac28181cce15ae350fadd755a51999f Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Use QList instead of QVector in implementation and docsJarek Kobus2020-07-091-8/+8
| | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-271-2/+2
| | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I685be5c4f16e7acfb38deafe3b92cfadb3a42188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* ObjGeometryLoader::doLoad(): Fix fall through warningsFriedemann Kleint2018-03-021-0/+2
| | | | | | | | | | | Fix: objgeometryloader.cpp:161:49: warning: this statement may fall through [-Wimplicit-fallthrough=] objgeometryloader.cpp:163:51: warning: this statement may fall through [-Wimplicit-fallthrough=] Amends 4338a85487788bb553cef0eaa5e5a3f929934eea. Change-Id: I4a77a6436eef0d91ccc69decdfe4365dfdc5df22 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* ObjGeometryLoader: Fix out of bound errorPaul Lemire2018-02-081-7/+7
| | | | | | | Apparently this was a major security issue reported to security.qt-project.org Change-Id: Id52f035134ca6111e24b5820eb1b64b99449e47f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deal with trailing spaces and crlfKevin Ottens2017-11-071-0/+4
| | | | | | | | | We ended up having corrupted meshes if the application which exported the OBJ was adding trailing white spaces. Also make sure we got a test case using crlf for end of lines. Change-Id: Iace9dbc3d0d124fefe9e3350d396fdf26555cd17 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't crash objgeometryloader on ill-formed face, just ignoreWieland Hagen2017-09-221-1/+1
| | | | | | | | For < 3 vertices, array accesses would fail, and face creation not make sense anyways Change-Id: I5eb746dfdec92d1c836e9870d87e7900530ec81c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.9.0' into 5.9Sean Harmer2017-05-201-1/+1
|\ | | | | | | Change-Id: Icb23dcb19d312559f5f4a71bde3dc26bf4a19408
| * Add qAsConst, range-loop might detach Qt container (clazy reports)Mike Krus2017-05-021-1/+1
| | | | | | | | | | Change-Id: I5d541cd0d08f17c25cbb839c111417130d133c3c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix build with QT_STRICT_ITERATORSSergio Martins2017-05-191-1/+1
|/ | | | | | | | Which also fixes potential bugs when comparing iterators from different containers in case a detach happens. Change-Id: I5e91f82177d46a0f06272035af837e8a8b196f81 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Don't explicitly disable the Qt3D category loggingLaszlo Agocs2017-03-311-1/+1
| | | | | | | | | | | | | Category logging is off by default, so explicitly turning it off will just make it harder to turn it on in the application. qt.*.debug has special behavior in the sense that defaults to off. Other categories, like Qt3D.*.debug default to true. Therefore the only correct way in Qt 3D is to always specify warning-and-up as the default enabled severity. Change-Id: I91daf48e049b7a9fcfac9720982138b178ee4804 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Improve documentation for QMeshMike Krus2017-02-061-2/+4
| | | | | | | | Also use QRegularExpression instead of the older QRegEx in the obj loader Change-Id: I031f98a718d81e9baeba7aeb6e3482bb22d5643f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* GeometryLoader const and cleanupGuillermo A. Amaral2017-01-201-10/+10
| | | | | Change-Id: I4a3bfc67c4149f0946ca30adfb308b8b67004b22 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QMesh geometry loading via plugin systemGuillermo A. Amaral2017-01-201-0/+255
Ported ObjLoader to a plugin based system. Change-Id: I4bf50fe869f04173c022b6a22c45944ecdad4703 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>