diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-03-27 14:48:28 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-03-30 16:05:33 +0000 |
commit | 1c153ec7ceae331809b504bed7241739bc60e5b2 (patch) | |
tree | 5c69488fc6d45edcf9d5cdf5a8dda7c427dc1b6e | |
parent | 22dcc3dcf0018ec8d2bfa50177b6f6d8d19b6a92 (diff) |
Remove pointless template member function from QAbstractFunctor
Use template free function instead.
Change-Id: I1171279423f164b877aaef21926ceda512fcbd2e
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/extras/text/qtextureatlas.cpp | 2 | ||||
-rw-r--r-- | src/render/frontend/qabstractfunctor.h | 7 | ||||
-rw-r--r-- | tests/auto/render/buffer/tst_buffer.cpp | 2 | ||||
-rw-r--r-- | tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp | 2 | ||||
-rw-r--r-- | tests/auto/render/meshfunctors/tst_meshfunctors.cpp | 6 | ||||
-rw-r--r-- | tests/auto/render/qbuffer/tst_qbuffer.cpp | 2 | ||||
-rw-r--r-- | tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp | 2 | ||||
-rw-r--r-- | tests/auto/render/textures/tst_textures.cpp | 4 |
8 files changed, 10 insertions, 17 deletions
diff --git a/src/extras/text/qtextureatlas.cpp b/src/extras/text/qtextureatlas.cpp index 49c6397d6..2b82010a6 100644 --- a/src/extras/text/qtextureatlas.cpp +++ b/src/extras/text/qtextureatlas.cpp @@ -179,7 +179,7 @@ Qt3DRender::QTextureDataPtr QTextureAtlasGenerator::operator()() bool QTextureAtlasGenerator::operator==(const QTextureGenerator &other) const { - const QTextureAtlasGenerator *otherFunctor = functor_cast<QTextureAtlasGenerator>(&other); + const QTextureAtlasGenerator *otherFunctor = Qt3DRender::functor_cast<QTextureAtlasGenerator>(&other); return (otherFunctor != nullptr && otherFunctor->m_data == m_data && otherFunctor->m_atlasId == m_atlasId diff --git a/src/render/frontend/qabstractfunctor.h b/src/render/frontend/qabstractfunctor.h index d9c4d65a4..c05c04743 100644 --- a/src/render/frontend/qabstractfunctor.h +++ b/src/render/frontend/qabstractfunctor.h @@ -80,13 +80,6 @@ public: virtual ~QAbstractFunctor(); virtual qintptr id() const = 0; - template<class T> - const T *functor_cast(const QAbstractFunctor *other) const - { - if (other->id() == functorTypeId<T>()) - return static_cast<const T *>(other); - return nullptr; - } private: Q_DISABLE_COPY(QAbstractFunctor) }; diff --git a/tests/auto/render/buffer/tst_buffer.cpp b/tests/auto/render/buffer/tst_buffer.cpp index b06425bd7..7f7c0adb9 100644 --- a/tests/auto/render/buffer/tst_buffer.cpp +++ b/tests/auto/render/buffer/tst_buffer.cpp @@ -50,7 +50,7 @@ public: bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const Q_DECL_FINAL { - const TestFunctor *otherFunctor = functor_cast<TestFunctor>(&other); + const TestFunctor *otherFunctor = Qt3DRender::functor_cast<TestFunctor>(&other); if (otherFunctor != nullptr) return otherFunctor->m_size == m_size; return false; diff --git a/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp b/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp index 7cf70c03c..70fe957c5 100644 --- a/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp +++ b/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp @@ -51,7 +51,7 @@ public: bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_FINAL { - const TestFactory *otherFactory = functor_cast<TestFactory>(&other); + const TestFactory *otherFactory = Qt3DRender::functor_cast<TestFactory>(&other); if (otherFactory != nullptr) return otherFactory->m_size == m_size; return false; diff --git a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp index 6aef510ea..bf5f0d55f 100644 --- a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp +++ b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp @@ -46,7 +46,7 @@ public: bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_OVERRIDE { - return functor_cast<MeshFunctorA>(&other); + return Qt3DRender::functor_cast<MeshFunctorA>(&other); } QT3D_FUNCTOR(MeshFunctorA) @@ -68,7 +68,7 @@ public: bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_OVERRIDE { - return functor_cast<MeshFunctorB>(&other); + return Qt3DRender::functor_cast<MeshFunctorB>(&other); } QT3D_FUNCTOR(MeshFunctorB) @@ -85,7 +85,7 @@ public: bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_OVERRIDE { - return functor_cast<MeshFunctorASub>(&other); + return Qt3DRender::functor_cast<MeshFunctorASub>(&other); } QT3D_FUNCTOR(MeshFunctorASub) diff --git a/tests/auto/render/qbuffer/tst_qbuffer.cpp b/tests/auto/render/qbuffer/tst_qbuffer.cpp index a65f27cb6..fdc25cbca 100644 --- a/tests/auto/render/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/render/qbuffer/tst_qbuffer.cpp @@ -51,7 +51,7 @@ public: bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const Q_DECL_FINAL { - const TestFunctor *otherFunctor = functor_cast<TestFunctor>(&other); + const TestFunctor *otherFunctor = Qt3DRender::functor_cast<TestFunctor>(&other); if (otherFunctor != nullptr) return otherFunctor->m_size == m_size; return false; diff --git a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp index 76c3288e3..94f720097 100644 --- a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp +++ b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp @@ -58,7 +58,7 @@ public: bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_FINAL { - const TestFactory *otherFactory = functor_cast<TestFactory>(&other); + const TestFactory *otherFactory = Qt3DRender::functor_cast<TestFactory>(&other); if (otherFactory != nullptr) return otherFactory->m_size == m_size; return false; diff --git a/tests/auto/render/textures/tst_textures.cpp b/tests/auto/render/textures/tst_textures.cpp index 58cb76c94..82c638275 100644 --- a/tests/auto/render/textures/tst_textures.cpp +++ b/tests/auto/render/textures/tst_textures.cpp @@ -57,7 +57,7 @@ public: } bool operator ==(const Qt3DRender::QTextureImageDataGenerator &other) const Q_DECL_OVERRIDE { - const TestImageDataGenerator *otherFunctor = functor_cast<TestImageDataGenerator>(&other); + const TestImageDataGenerator *otherFunctor = Qt3DRender::functor_cast<TestImageDataGenerator>(&other); return (otherFunctor != Q_NULLPTR && otherFunctor->m_id == m_id); } @@ -78,7 +78,7 @@ public: } bool operator ==(const Qt3DRender::QTextureGenerator &other) const Q_DECL_OVERRIDE { - const TestTextureGenerator *otherFunctor = functor_cast<TestTextureGenerator>(&other); + const TestTextureGenerator *otherFunctor = Qt3DRender::functor_cast<TestTextureGenerator>(&other); return (otherFunctor != Q_NULLPTR && otherFunctor->m_id == m_id); } |