summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/qgeometryrenderer
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-11-16 14:43:51 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-11-18 20:43:32 +0100
commitfdba23fe5ed5eb87a6bab7bc16d04b7e240a4d7e (patch)
treed40a14ea2bc56ee84fe5f988f75960e11bec2f5d /tests/auto/render/qgeometryrenderer
parenta3b3cf04271cdc98af947823aa005a8090a1d37a (diff)
QGeometryFactory: don't make op== virtual
That's too clever, and it backfires with compilation errors in C++20 mode: qt3d/tests/auto/render/meshfunctors/tst_meshfunctors.cpp:129:29: error: ambiguous overload for ‘operator==’ (operand types are ‘MeshFunctorA’ and ‘MeshFunctorB’) 129 | QVERIFY(!(*functorA == *functorB)); | ~~~~~~~~~ ^~ ~~~~~~~~~ | | | | MeshFunctorA MeshFunctorB qt3d/tests/auto/render/meshfunctors/tst_meshfunctors.cpp:72:10: note: candidate: ‘virtual bool MeshFunctorB::operator==(const Qt3DCore::QGeometryFactory&) const’ (reversed) 72 | bool operator ==(const Qt3DCore::QGeometryFactory &other) const override | ^~~~~~~~ qt3d/tests/auto/render/meshfunctors/tst_meshfunctors.cpp:50:10: note: candidate: ‘virtual bool MeshFunctorA::operator==(const Qt3DCore::QGeometryFactory&) const’ 50 | bool operator ==(const Qt3DCore::QGeometryFactory &other) const override | ^~~~~~~~ Fix by providing a symmetric operator== for QGeometryFactory that delegates to a virtual equals() method. Change-Id: I23d29ad1b16075629132f2b4757c5810d5615a36 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit ec291f9974ba6d25148955a0b9e55b30c589a9be) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/render/qgeometryrenderer')
-rw-r--r--tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp
index 8cfbc0d23..8addfe9ad 100644
--- a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp
+++ b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp
@@ -56,7 +56,7 @@ public:
return nullptr;
}
- bool operator ==(const Qt3DRender::QGeometryFactory &other) const final
+ bool equals(const Qt3DRender::QGeometryFactory &other) const final
{
const TestFactory *otherFactory = Qt3DRender::functor_cast<TestFactory>(&other);
if (otherFactory != nullptr)