diff options
Diffstat (limited to 'tests')
49 files changed, 422 insertions, 198 deletions
diff --git a/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp b/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp index 28ab8917a..462c02518 100644 --- a/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp +++ b/tests/auto/animation/additiveclipblend/tst_additiveclipblend.cpp @@ -50,22 +50,22 @@ public: , m_duration(duration) {} - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const Q_DECL_OVERRIDE + inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const Q_DECL_FINAL + QVector<Qt3DCore::QNodeId> currentDependencyIds() const final { return QVector<Qt3DCore::QNodeId>(); } using ClipBlendNode::setClipResults; - double duration() const Q_DECL_FINAL { return m_duration; } + double duration() const final { return m_duration; } protected: - ClipResults doBlend(const QVector<ClipResults> &) const Q_DECL_FINAL { return ClipResults(); } + ClipResults doBlend(const QVector<ClipResults> &) const final { return ClipResults(); } private: double m_duration; diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp index e5c077657..cec2dc8af 100644 --- a/tests/auto/animation/animationutils/tst_animationutils.cpp +++ b/tests/auto/animation/animationutils/tst_animationutils.cpp @@ -84,22 +84,22 @@ public: m_value2Id = value2Id; } - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const Q_DECL_OVERRIDE + inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const Q_DECL_FINAL + QVector<Qt3DCore::QNodeId> currentDependencyIds() const final { return QVector<Qt3DCore::QNodeId>() << m_value1Id << m_value2Id; } using ClipBlendNode::setClipResults; - double duration() const Q_DECL_FINAL { return 0.0f; } + double duration() const final { return 0.0f; } protected: - ClipResults doBlend(const QVector<ClipResults> &blendData) const Q_DECL_FINAL + ClipResults doBlend(const QVector<ClipResults> &blendData) const final { Q_ASSERT(blendData.size() == 2); const int elementCount = blendData.first().size(); diff --git a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp index b64e263bf..dab6e698d 100644 --- a/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp +++ b/tests/auto/animation/clipblendnode/tst_clipblendnode.cpp @@ -54,22 +54,22 @@ public: , m_clipResults(clipResults) {} - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const Q_DECL_OVERRIDE + inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const Q_DECL_FINAL + QVector<Qt3DCore::QNodeId> currentDependencyIds() const final { return QVector<Qt3DCore::QNodeId>(); } using ClipBlendNode::setClipResults; - double duration() const Q_DECL_FINAL { return 0.0f; } + double duration() const final { return 0.0f; } protected: - ClipResults doBlend(const QVector<ClipResults> &) const Q_DECL_FINAL + ClipResults doBlend(const QVector<ClipResults> &) const final { return m_clipResults; } diff --git a/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp b/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp index 7bcef28ae..489a2f019 100644 --- a/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp +++ b/tests/auto/animation/clipblendnodemanager/tst_clipblendnodemanager.cpp @@ -49,20 +49,20 @@ public: deadCount += 1; } - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const Q_DECL_OVERRIDE + inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const Q_DECL_FINAL + QVector<Qt3DCore::QNodeId> currentDependencyIds() const final { return QVector<Qt3DCore::QNodeId>(); } - double duration() const Q_DECL_FINAL { return 0.0f; } + double duration() const final { return 0.0f; } protected: - Qt3DAnimation::Animation::ClipResults doBlend(const QVector<Qt3DAnimation::Animation::ClipResults> &) const Q_DECL_FINAL + Qt3DAnimation::Animation::ClipResults doBlend(const QVector<Qt3DAnimation::Animation::ClipResults> &) const final { return Qt3DAnimation::Animation::ClipResults(); } diff --git a/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp b/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp index 003b1ef53..e75c4f2f8 100644 --- a/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp +++ b/tests/auto/animation/lerpclipblend/tst_lerpclipblend.cpp @@ -50,22 +50,22 @@ public: , m_duration(duration) {} - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const Q_DECL_OVERRIDE + inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - QVector<Qt3DCore::QNodeId> currentDependencyIds() const Q_DECL_FINAL + QVector<Qt3DCore::QNodeId> currentDependencyIds() const final { return QVector<Qt3DCore::QNodeId>(); } using ClipBlendNode::setClipResults; - double duration() const Q_DECL_FINAL { return m_duration; } + double duration() const final { return m_duration; } protected: - ClipResults doBlend(const QVector<ClipResults> &) const Q_DECL_FINAL { return ClipResults(); } + ClipResults doBlend(const QVector<ClipResults> &) const final { return ClipResults(); } private: double m_duration; diff --git a/tests/auto/core/common/testpostmanarbiter.h b/tests/auto/core/common/testpostmanarbiter.h index 731f16f0f..7d7e4e49b 100644 --- a/tests/auto/core/common/testpostmanarbiter.h +++ b/tests/auto/core/common/testpostmanarbiter.h @@ -42,10 +42,10 @@ class TestPostman : public Qt3DCore::QAbstractPostman { public: explicit TestPostman(TestArbiter *arbiter); - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) Q_DECL_FINAL; - void setScene(Qt3DCore::QScene *) Q_DECL_FINAL; - void notifyBackend(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; - bool shouldNotifyFrontend(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) final; + void setScene(Qt3DCore::QScene *) final; + void notifyBackend(const Qt3DCore::QSceneChangePtr &e) final; + bool shouldNotifyFrontend(const Qt3DCore::QSceneChangePtr &e) final; private: TestArbiter *m_arbiter; @@ -57,13 +57,13 @@ public: TestArbiter(); ~TestArbiter(); - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) final; - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e) final; - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) Q_DECL_FINAL; + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) final; - Qt3DCore::QAbstractPostman *postman() const Q_DECL_FINAL; + Qt3DCore::QAbstractPostman *postman() const final; QVector<Qt3DCore::QSceneChangePtr> events; diff --git a/tests/auto/core/nodes/tst_nodes.cpp b/tests/auto/core/nodes/tst_nodes.cpp index 49618821c..0ec661fed 100644 --- a/tests/auto/core/nodes/tst_nodes.cpp +++ b/tests/auto/core/nodes/tst_nodes.cpp @@ -105,10 +105,10 @@ public: : m_spy(spy) {} - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) Q_DECL_FINAL {}; - void setScene(Qt3DCore::QScene *) Q_DECL_FINAL {}; - void notifyBackend(const Qt3DCore::QSceneChangePtr &change) Q_DECL_FINAL; - bool shouldNotifyFrontend(const Qt3DCore::QSceneChangePtr &changee) Q_DECL_FINAL { Q_UNUSED(changee); return false; } + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) final {}; + void setScene(Qt3DCore::QScene *) final {}; + void notifyBackend(const Qt3DCore::QSceneChangePtr &change) final; + bool shouldNotifyFrontend(const Qt3DCore::QSceneChangePtr &changee) final { Q_UNUSED(changee); return false; } private: ObserverSpy *m_spy; @@ -139,24 +139,24 @@ public: { } - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e) override { events << ChangeRecord(e, true); } - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) Q_DECL_OVERRIDE + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) override { for (size_t i = 0, m = e.size(); i < m; ++i) { events << ChangeRecord(e.at(i), false); } } - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) override { events << ChangeRecord(e, false); } - Qt3DCore::QAbstractPostman *postman() const Q_DECL_FINAL + Qt3DCore::QAbstractPostman *postman() const final { return m_postman.data(); } diff --git a/tests/auto/core/qaspectengine/tst_qaspectengine.cpp b/tests/auto/core/qaspectengine/tst_qaspectengine.cpp index ba76d2100..94519f5e5 100644 --- a/tests/auto/core/qaspectengine/tst_qaspectengine.cpp +++ b/tests/auto/core/qaspectengine/tst_qaspectengine.cpp @@ -46,23 +46,23 @@ public: } private: - void onRegistered() Q_DECL_OVERRIDE + void onRegistered() override { qDebug() << Q_FUNC_INFO; } - void onEngineStartup() Q_DECL_OVERRIDE + void onEngineStartup() override { qDebug() << Q_FUNC_INFO; m_rootEntityId = rootEntityId(); } - void onEngineShutdown() Q_DECL_OVERRIDE + void onEngineShutdown() override { qDebug() << Q_FUNC_INFO; } - QVector<QAspectJobPtr> jobsToExecute(qint64) Q_DECL_OVERRIDE \ + QVector<QAspectJobPtr> jobsToExecute(qint64) override \ { if (m_rootEntityId) qDebug() << Q_FUNC_INFO << m_rootEntityId; @@ -81,16 +81,16 @@ public: \ : QAbstractAspect(parent) {} \ \ private: \ - void onRegistered() Q_DECL_OVERRIDE {} \ - void onEngineStartup() Q_DECL_OVERRIDE {} \ - void onEngineShutdown() Q_DECL_OVERRIDE {} \ + void onRegistered() override {} \ + void onEngineStartup() override {} \ + void onEngineShutdown() override {} \ \ - QVector<QAspectJobPtr> jobsToExecute(qint64) Q_DECL_OVERRIDE \ + QVector<QAspectJobPtr> jobsToExecute(qint64) override \ { \ return QVector<QAspectJobPtr>(); \ } \ \ - QVariant executeCommand(const QStringList &args) Q_DECL_OVERRIDE \ + QVariant executeCommand(const QStringList &args) override \ { \ if (args.size() >= 2 && args.first() == QLatin1Literal("echo")) { \ QStringList list = args; \ diff --git a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp index 0dc8ce10d..87ff528f0 100644 --- a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp +++ b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp @@ -41,11 +41,11 @@ public: \ : QAbstractAspect(parent) {} \ \ private: \ - void onRegistered() Q_DECL_OVERRIDE {} \ - void onEngineStartup() Q_DECL_OVERRIDE {} \ - void onEngineShutdown() Q_DECL_OVERRIDE {} \ + void onRegistered() override {} \ + void onEngineStartup() override {} \ + void onEngineShutdown() override {} \ \ - QVector<QAspectJobPtr> jobsToExecute(qint64) Q_DECL_OVERRIDE \ + QVector<QAspectJobPtr> jobsToExecute(qint64) override \ { \ return QVector<QAspectJobPtr>(); \ } \ diff --git a/tests/auto/core/qaspectjob/tst_qaspectjob.cpp b/tests/auto/core/qaspectjob/tst_qaspectjob.cpp index b9f7934ab..b5750e639 100644 --- a/tests/auto/core/qaspectjob/tst_qaspectjob.cpp +++ b/tests/auto/core/qaspectjob/tst_qaspectjob.cpp @@ -34,7 +34,7 @@ using namespace Qt3DCore; class FakeAspectJob : public QAspectJob { public: - void run() Q_DECL_OVERRIDE {} + void run() override {} }; class tst_QAspectJob : public QObject diff --git a/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp b/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp index 57f7e7ed4..4beb28bc2 100644 --- a/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp +++ b/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp @@ -117,7 +117,7 @@ public: Qt3DCore::QNodePrivate::get(this)->notifyObservers(e); } - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) override { QVERIFY(!change.isNull()); m_lastChanges << change; @@ -182,7 +182,7 @@ class tst_SimpleObserver : public Qt3DCore::QObserverInterface public: // QObserverInterface interface - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) override { QVERIFY(!e.isNull()); m_lastChanges.append(e); @@ -218,7 +218,7 @@ public: {} // QObserverInterface interface - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) override { QVERIFY(!e.isNull()); m_lastChanges << e; @@ -271,7 +271,7 @@ public: ~ThreadedAnswer() { qDebug() << this; } - void run() Q_DECL_OVERRIDE + void run() override { // create backend change queue on QChangeArbiter Qt3DCore::QChangeArbiter::createThreadLocalChangeQueue(m_arbiter); @@ -301,7 +301,7 @@ public: , m_allowFrontendNotifications(false) {} - void setScene(Qt3DCore::QScene *scene) Q_DECL_FINAL + void setScene(Qt3DCore::QScene *scene) final { m_sceneInterface = scene; } @@ -334,7 +334,7 @@ public: return m_lastChanges; } - void notifyBackend(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL + void notifyBackend(const Qt3DCore::QSceneChangePtr &e) final { m_sceneInterface->arbiter()->sceneChangeEventWithLock(e); } diff --git a/tests/auto/core/qpostman/tst_qpostman.cpp b/tests/auto/core/qpostman/tst_qpostman.cpp index 612db6257..6fcb6e840 100644 --- a/tests/auto/core/qpostman/tst_qpostman.cpp +++ b/tests/auto/core/qpostman/tst_qpostman.cpp @@ -53,7 +53,7 @@ public: inline bool hasReceivedChange() const { return m_hasReceivedChange; } protected: - void sceneChangeEvent(const QSceneChangePtr &) Q_DECL_OVERRIDE + void sceneChangeEvent(const QSceneChangePtr &) override { m_hasReceivedChange = true; } diff --git a/tests/auto/core/qscene/tst_qscene.cpp b/tests/auto/core/qscene/tst_qscene.cpp index 78f17e8fa..36ec14b4e 100644 --- a/tests/auto/core/qscene/tst_qscene.cpp +++ b/tests/auto/core/qscene/tst_qscene.cpp @@ -63,9 +63,9 @@ private slots: class tst_LockableObserver : public Qt3DCore::QLockableObserverInterface { public: - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) Q_DECL_OVERRIDE {} - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &) Q_DECL_OVERRIDE {} - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &) Q_DECL_OVERRIDE {} + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) override {} + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &) override {} + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &) override {} }; class tst_Observable : public Qt3DCore::QObservableInterface diff --git a/tests/auto/core/qservicelocator/tst_qservicelocator.cpp b/tests/auto/core/qservicelocator/tst_qservicelocator.cpp index 24d9cce68..cde9834b4 100644 --- a/tests/auto/core/qservicelocator/tst_qservicelocator.cpp +++ b/tests/auto/core/qservicelocator/tst_qservicelocator.cpp @@ -55,8 +55,8 @@ public: : QSystemInformationService(QStringLiteral("Dummy System Information Service")) {} - QStringList aspectNames() const Q_DECL_FINAL { return QStringList(); } - int threadPoolThreadCount() const Q_DECL_FINAL { return 4; } + QStringList aspectNames() const final { return QStringList(); } + int threadPoolThreadCount() const final { return 4; } }; diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index 2fc6e8c3b..bc4552c66 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -86,7 +86,7 @@ public: void setMutex(QMutex *mutex); - void run() Q_DECL_OVERRIDE; + void run() override; private: TestFunction m_func; @@ -119,7 +119,7 @@ class MassAspectJob : public Qt3DCore::QAspectJob public: MassAspectJob(MassFunction func, QVector3D *data); - void run() Q_DECL_OVERRIDE; + void run() override; private: MassFunction m_func; diff --git a/tests/auto/coretest/testpostmanarbiter_p.h b/tests/auto/coretest/testpostmanarbiter_p.h index 7785b864a..26c0cbc67 100644 --- a/tests/auto/coretest/testpostmanarbiter_p.h +++ b/tests/auto/coretest/testpostmanarbiter_p.h @@ -56,10 +56,10 @@ class TestPostman : public Qt3DCore::QAbstractPostman { public: explicit TestPostman(TestArbiter *arbiter); - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) Q_DECL_FINAL; - void setScene(Qt3DCore::QScene *) Q_DECL_FINAL; - void notifyBackend(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; - bool shouldNotifyFrontend(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) final; + void setScene(Qt3DCore::QScene *) final; + void notifyBackend(const Qt3DCore::QSceneChangePtr &e) final; + bool shouldNotifyFrontend(const Qt3DCore::QSceneChangePtr &e) final; private: TestArbiter *m_arbiter; @@ -71,13 +71,13 @@ public: TestArbiter(); ~TestArbiter(); - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) final; - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e) Q_DECL_FINAL; + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangePtr &e) final; - void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) Q_DECL_FINAL; + void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) final; - Qt3DCore::QAbstractPostman *postman() const Q_DECL_FINAL; + Qt3DCore::QAbstractPostman *postman() const final; QVector<Qt3DCore::QSceneChangePtr> events; diff --git a/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp b/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp index 97e9b7c77..1390b6b49 100644 --- a/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp +++ b/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp @@ -47,7 +47,7 @@ public: } private: - Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE + Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const override { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<Qt3DInput::QAbstractAxisInputData>::create(this); auto &data = creationChange->data; @@ -64,7 +64,7 @@ public: { } - float process(Qt3DInput::Input::InputHandler *inputHandler, qint64 currentTime) Q_DECL_OVERRIDE + float process(Qt3DInput::Input::InputHandler *inputHandler, qint64 currentTime) override { Q_UNUSED(inputHandler); Q_UNUSED(currentTime); diff --git a/tests/auto/input/commons/testdevice.h b/tests/auto/input/commons/testdevice.h index 52750029e..936a0d1b2 100644 --- a/tests/auto/input/commons/testdevice.h +++ b/tests/auto/input/commons/testdevice.h @@ -43,12 +43,12 @@ public: : Qt3DInput::QAbstractPhysicalDevice(parent) {} - int axisCount() const Q_DECL_FINAL { return 0; } - int buttonCount() const Q_DECL_FINAL { return 0; } - QStringList axisNames() const Q_DECL_FINAL { return QStringList(); } - QStringList buttonNames() const Q_DECL_FINAL { return QStringList(); } - int axisIdentifier(const QString &name) const Q_DECL_FINAL { Q_UNUSED(name) return 0; } - int buttonIdentifier(const QString &name) const Q_DECL_FINAL { Q_UNUSED(name) return 0; } + int axisCount() const final { return 0; } + int buttonCount() const final { return 0; } + QStringList axisNames() const final { return QStringList(); } + QStringList buttonNames() const final { return QStringList(); } + int axisIdentifier(const QString &name) const final { Q_UNUSED(name) return 0; } + int buttonIdentifier(const QString &name) const final { Q_UNUSED(name) return 0; } private: friend class TestDeviceBackendNode; @@ -63,7 +63,7 @@ public: Qt3DCore::QBackendNodeTester().simulateInitialization(device, this); } - float axisValue(int axisIdentifier) const Q_DECL_FINAL + float axisValue(int axisIdentifier) const final { return m_axisValues.value(axisIdentifier); } @@ -73,7 +73,7 @@ public: m_axisValues.insert(axisIdentifier, value); } - bool isButtonPressed(int buttonIdentifier) const Q_DECL_FINAL + bool isButtonPressed(int buttonIdentifier) const final { return m_buttonStates.value(buttonIdentifier); } @@ -103,13 +103,13 @@ public: qDeleteAll(m_deviceBackendNodes); } - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) Q_DECL_FINAL + QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) final { Q_UNUSED(time); return QVector<Qt3DCore::QAspectJobPtr>(); } - TestDevice *createPhysicalDevice(const QString &name) Q_DECL_FINAL + TestDevice *createPhysicalDevice(const QString &name) final { Q_ASSERT(!deviceNames().contains(name)); auto device = new TestDevice(m_devicesParent.data()); // Avoids unwanted reparenting @@ -119,7 +119,7 @@ public: return device; } - QVector<Qt3DCore::QNodeId> physicalDevices() const Q_DECL_FINAL + QVector<Qt3DCore::QNodeId> physicalDevices() const final { QVector<Qt3DCore::QNodeId> ids; std::transform(m_devices.constBegin(), m_devices.constEnd(), @@ -128,7 +128,7 @@ public: return ids; } - TestDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId id) const Q_DECL_FINAL + TestDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId id) const final { auto it = std::find_if(m_deviceBackendNodes.constBegin(), m_deviceBackendNodes.constEnd(), [id] (TestDeviceBackendNode *node) { return node->peerId() == id; }); @@ -138,7 +138,7 @@ public: return *it; } - QStringList deviceNames() const Q_DECL_FINAL + QStringList deviceNames() const final { QStringList names; std::transform(m_devices.constBegin(), m_devices.constEnd(), @@ -148,7 +148,7 @@ public: } private: - void onInitialize() Q_DECL_FINAL {} + void onInitialize() final {} QScopedPointer<Qt3DCore::QNode> m_devicesParent; QVector<TestDevice*> m_devices; diff --git a/tests/auto/input/commons/testdeviceproxy.h b/tests/auto/input/commons/testdeviceproxy.h index 366f40958..13e10d501 100644 --- a/tests/auto/input/commons/testdeviceproxy.h +++ b/tests/auto/input/commons/testdeviceproxy.h @@ -56,12 +56,12 @@ public: Right }; - int axisCount() const Q_DECL_FINAL { return 3; } - int buttonCount() const Q_DECL_FINAL { return 2; } - QStringList axisNames() const Q_DECL_FINAL { return QStringList() << QStringLiteral("x") << QStringLiteral("y") << QStringLiteral("z"); } - QStringList buttonNames() const Q_DECL_FINAL { return QStringList() << QStringLiteral("Left") << QStringLiteral("Right"); } + int axisCount() const final { return 3; } + int buttonCount() const final { return 2; } + QStringList axisNames() const final { return QStringList() << QStringLiteral("x") << QStringLiteral("y") << QStringLiteral("z"); } + QStringList buttonNames() const final { return QStringList() << QStringLiteral("Left") << QStringLiteral("Right"); } - int axisIdentifier(const QString &name) const Q_DECL_FINAL + int axisIdentifier(const QString &name) const final { if (name == QLatin1String("x")) return TestPhysicalDevice::X; @@ -71,7 +71,7 @@ public: return TestPhysicalDevice::Z; return -1; } - int buttonIdentifier(const QString &name) const Q_DECL_FINAL + int buttonIdentifier(const QString &name) const final { if (name == QLatin1String("Left")) return TestPhysicalDevice::Left; diff --git a/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp b/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp index d3745b8cb..a436959cc 100644 --- a/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp +++ b/tests/auto/input/loadproxydevicejob/tst_loadproxydevicejob.cpp @@ -47,35 +47,35 @@ public: , m_name(name) {} - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) Q_DECL_OVERRIDE + QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override { return QVector<Qt3DCore::QAspectJobPtr>(); } - Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &name) Q_DECL_OVERRIDE + Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &name) override { if (name == m_name) return new TestPhysicalDevice(); return nullptr; } - Qt3DInput::QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId) const Q_DECL_OVERRIDE + Qt3DInput::QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId) const override { return nullptr; } - QVector<Qt3DCore::QNodeId> physicalDevices() const Q_DECL_OVERRIDE + QVector<Qt3DCore::QNodeId> physicalDevices() const override { return QVector<Qt3DCore::QNodeId>(); } - QStringList deviceNames() const Q_DECL_OVERRIDE + QStringList deviceNames() const override { return QStringList() << m_name; } private: - void onInitialize() Q_DECL_OVERRIDE {} + void onInitialize() override {} QString m_name; }; diff --git a/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp b/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp index 0cf37fe95..d146a80e7 100644 --- a/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp +++ b/tests/auto/input/qabstractphysicaldevicebackendnode/tst_qabstractphysicaldevicebackendnode.cpp @@ -49,14 +49,14 @@ public: : Qt3DInput::QAbstractPhysicalDeviceBackendNode(mode) {} - float axisValue(int axisIdentifier) const Q_DECL_OVERRIDE + float axisValue(int axisIdentifier) const override { if (axisIdentifier == 883) return 883.0f; return 0.0f; } - bool isButtonPressed(int buttonIdentifier) const Q_DECL_OVERRIDE + bool isButtonPressed(int buttonIdentifier) const override { if (buttonIdentifier == 454) return true; diff --git a/tests/auto/input/utils/tst_utils.cpp b/tests/auto/input/utils/tst_utils.cpp index 766408ce3..d90034a3f 100644 --- a/tests/auto/input/utils/tst_utils.cpp +++ b/tests/auto/input/utils/tst_utils.cpp @@ -56,12 +56,12 @@ public: , m_device(device) {} - QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) Q_DECL_OVERRIDE { return QVector<Qt3DCore::QAspectJobPtr>(); } - Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &) Q_DECL_OVERRIDE { return nullptr; } - QVector<Qt3DCore::QNodeId> physicalDevices() const Q_DECL_OVERRIDE { return QVector<Qt3DCore::QNodeId>(); } - QStringList deviceNames() const Q_DECL_OVERRIDE { return QStringList(); } + QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64) override { return QVector<Qt3DCore::QAspectJobPtr>(); } + Qt3DInput::QAbstractPhysicalDevice *createPhysicalDevice(const QString &) override { return nullptr; } + QVector<Qt3DCore::QNodeId> physicalDevices() const override { return QVector<Qt3DCore::QNodeId>(); } + QStringList deviceNames() const override { return QStringList(); } - Qt3DInput::QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId deviceId) const Q_DECL_OVERRIDE + Qt3DInput::QAbstractPhysicalDeviceBackendNode *physicalDevice(Qt3DCore::QNodeId deviceId) const override { if (m_device->id() == deviceId) return new FakeBackendDevice(); @@ -69,7 +69,7 @@ public: } private: - void onInitialize() Q_DECL_OVERRIDE {} + void onInitialize() override {} Qt3DInput::QAbstractPhysicalDevice *m_device; }; diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h b/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h index ab0240419..62d71b224 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h +++ b/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h @@ -61,27 +61,27 @@ public: endInsertRows(); } - int rowCount(const QModelIndex &) const Q_DECL_OVERRIDE + int rowCount(const QModelIndex &) const override { return items.count(); } - virtual QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE + QHash<int, QByteArray> roleNames() const override { return roles; } - virtual int columnCount(const QModelIndex &) const Q_DECL_OVERRIDE + int columnCount(const QModelIndex &) const override { return 1; } - virtual bool hasChildren(const QModelIndex &) const Q_DECL_OVERRIDE + bool hasChildren(const QModelIndex &) const override { return rowCount(QModelIndex()) > 0; } - virtual QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE + QModelIndex index(int row, int column, const QModelIndex &parent) const override { Q_UNUSED(column); if (row>=0 && row<rowCount(parent)) @@ -90,12 +90,12 @@ public: return QModelIndex(); } - virtual QModelIndex parent(const QModelIndex &) const Q_DECL_OVERRIDE + QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); } - QVariant data (const QModelIndex & index, int role) const Q_DECL_OVERRIDE + QVariant data (const QModelIndex & index, int role) const override { int row = index.row(); if ((row<0) || (row>=items.count())) diff --git a/tests/auto/render/boundingsphere/tst_boundingsphere.cpp b/tests/auto/render/boundingsphere/tst_boundingsphere.cpp index fcbfaf6ba..767df4604 100644 --- a/tests/auto/render/boundingsphere/tst_boundingsphere.cpp +++ b/tests/auto/render/boundingsphere/tst_boundingsphere.cpp @@ -65,6 +65,8 @@ #include <Qt3DExtras/qcuboidmesh.h> #include <Qt3DExtras/qplanemesh.h> +#include <qbackendnodetester.h> + QT_BEGIN_NAMESPACE namespace Qt3DRender { @@ -100,6 +102,7 @@ public: Qt3DRender::Render::FrameGraphNode *frameGraphRoot() const { return d_func()->m_renderer->frameGraphRoot(); } Qt3DRender::Render::RenderSettings *renderSettings() const { return d_func()->m_renderer->settings(); } Qt3DRender::Render::Entity *sceneRoot() const { return m_sceneRoot; } + Qt3DRender::Render::AbstractRenderer *renderer() const { return d_func()->m_renderer; } private: Render::Entity *m_sceneRoot; @@ -153,7 +156,7 @@ void runRequiredJobs(Qt3DRender::TestAspect *test) } // anonymous -class tst_BoundingSphere : public QObject +class tst_BoundingSphere : public Qt3DCore::QBackendNodeTester { Q_OBJECT private: @@ -194,6 +197,138 @@ private Q_SLOTS: QVERIFY(qAbs(boundingSphere->center().y() - sphereCenter.y()) < 0.000001f); QVERIFY(qAbs(boundingSphere->center().z() - sphereCenter.z()) < 0.000001f); } + + void checkCustomGeometry_data() + { + QTest::addColumn<int>("drawVertexCount"); + QTest::addColumn<int>("indexByteOffset"); + QTest::addColumn<QVector3D>("expectedCenter"); + QTest::addColumn<float>("expectedRadius"); + QTest::newRow("all") << 0 << 0 << QVector3D(-0.488892f, 0.0192147f, -75.4804f) << 25.5442f; + QTest::newRow("first only") << 3 << 0 << QVector3D(0, 1, -100) << 1.0f; + QTest::newRow("second only") << 3 << int(3 * sizeof(ushort)) << QVector3D(0, -1, -50) << 1.0f; + } + + void checkCustomGeometry() + { + QFETCH(int, drawVertexCount); + QFETCH(int, indexByteOffset); + QFETCH(QVector3D, expectedCenter); + QFETCH(float, expectedRadius); + + // two triangles with different Z, and an index buffer + QByteArray vdata; + vdata.resize(6 * 3 * sizeof(float)); + float *vp = reinterpret_cast<float *>(vdata.data()); + *vp++ = -1.0f; + *vp++ = 1.0f; + *vp++ = -100.0f; + *vp++ = 0.0f; + *vp++ = 0.0f; + *vp++ = -100.0f; + *vp++ = 1.0f; + *vp++ = 1.0f; + *vp++ = -100.0f; + + *vp++ = -1.0f; + *vp++ = -1.0f; + *vp++ = -50.0f; + *vp++ = 0.0f; + *vp++ = 0.0f; + *vp++ = -50.0f; + *vp++ = 1.0f; + *vp++ = -1.0f; + *vp++ = -50.0f; + + QByteArray idata; + idata.resize(6 * sizeof(ushort)); + ushort *ip = reinterpret_cast<ushort *>(idata.data()); + *ip++ = 0; + *ip++ = 1; + *ip++ = 2; + *ip++ = 3; + *ip++ = 4; + *ip++ = 5; + + QScopedPointer<Qt3DCore::QEntity> entity(new Qt3DCore::QEntity); + QScopedPointer<Qt3DRender::TestAspect> test(new Qt3DRender::TestAspect(entity.data())); + Qt3DRender::QBuffer *vbuffer = new Qt3DRender::QBuffer; + Qt3DRender::QBuffer *ibuffer = new Qt3DRender::QBuffer; + + vbuffer->setData(vdata); + Qt3DRender::Render::Buffer *vbufferBackend = test->nodeManagers()->bufferManager()->getOrCreateResource(vbuffer->id()); + vbufferBackend->setRenderer(test->renderer()); + vbufferBackend->setManager(test->nodeManagers()->bufferManager()); + simulateInitialization(vbuffer, vbufferBackend); + + ibuffer->setData(idata); + Qt3DRender::Render::Buffer *ibufferBackend = test->nodeManagers()->bufferManager()->getOrCreateResource(ibuffer->id()); + ibufferBackend->setRenderer(test->renderer()); + ibufferBackend->setManager(test->nodeManagers()->bufferManager()); + simulateInitialization(ibuffer, ibufferBackend); + + Qt3DRender::QGeometry *g = new Qt3DRender::QGeometry; + for (int i = 0; i < 2; ++i) + g->addAttribute(new Qt3DRender::QAttribute); + + const QVector<Qt3DRender::QAttribute *> attrs = g->attributes(); + Qt3DRender::QAttribute *attr = attrs[0]; + attr->setBuffer(vbuffer); + attr->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); + attr->setVertexBaseType(Qt3DRender::QAttribute::Float); + attr->setVertexSize(3); + attr->setCount(6); + attr->setByteOffset(0); + attr->setByteStride(3 * sizeof(float)); + + attr = attrs[1]; + attr->setBuffer(ibuffer); + attr->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + attr->setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort); + attr->setVertexSize(1); + attr->setCount(6); + attr->setByteOffset(indexByteOffset); + + Qt3DRender::QGeometryRenderer *gr = new Qt3DRender::QGeometryRenderer; + gr->setVertexCount(drawVertexCount); // when 0, indexAttribute->count() is used instead + gr->setGeometry(g); + entity->addComponent(gr); + + Qt3DRender::Render::Attribute *attr0Backend = test->nodeManagers()->attributeManager()->getOrCreateResource(attrs[0]->id()); + attr0Backend->setRenderer(test->renderer()); + simulateInitialization(attrs[0], attr0Backend); + Qt3DRender::Render::Attribute *attr1Backend = test->nodeManagers()->attributeManager()->getOrCreateResource(attrs[1]->id()); + attr1Backend->setRenderer(test->renderer()); + simulateInitialization(attrs[1], attr1Backend); + + Qt3DRender::Render::Geometry *gBackend = test->nodeManagers()->geometryManager()->getOrCreateResource(g->id()); + gBackend->setRenderer(test->renderer()); + simulateInitialization(g, gBackend); + + Qt3DRender::Render::GeometryRenderer *grBackend = test->nodeManagers()->geometryRendererManager()->getOrCreateResource(gr->id()); + grBackend->setRenderer(test->renderer()); + grBackend->setManager(test->nodeManagers()->geometryRendererManager()); + simulateInitialization(gr, grBackend); + + Qt3DRender::Render::Entity *entityBackend = test->nodeManagers()->renderNodesManager()->getOrCreateResource(entity->id()); + entityBackend->setRenderer(test->renderer()); + simulateInitialization(entity.data(), entityBackend); + + Qt3DRender::Render::CalculateBoundingVolumeJob calcBVolume; + calcBVolume.setManagers(test->nodeManagers()); + calcBVolume.setRoot(test->sceneRoot()); + calcBVolume.run(); + + QVector3D center = entityBackend->localBoundingVolume()->center(); + float radius = entityBackend->localBoundingVolume()->radius(); + qDebug() << radius << center; + + // truncate and compare integers only + QVERIFY(int(radius) == int(expectedRadius)); + QVERIFY(int(center.x()) == int(expectedCenter.x())); + QVERIFY(int(center.y()) == int(expectedCenter.y())); + QVERIFY(int(center.z()) == int(expectedCenter.z())); + } }; QTEST_MAIN(tst_BoundingSphere) diff --git a/tests/auto/render/buffer/tst_buffer.cpp b/tests/auto/render/buffer/tst_buffer.cpp index f9a54c8bf..a23e46c65 100644 --- a/tests/auto/render/buffer/tst_buffer.cpp +++ b/tests/auto/render/buffer/tst_buffer.cpp @@ -43,12 +43,12 @@ public: : m_size(size) {} - QByteArray operator ()() Q_DECL_FINAL + QByteArray operator ()() final { return QByteArrayLiteral("454"); } - bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const Q_DECL_FINAL + bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const final { const TestFunctor *otherFunctor = Qt3DRender::functor_cast<TestFunctor>(&other); if (otherFunctor != nullptr) diff --git a/tests/auto/render/commons/testrenderer.h b/tests/auto/render/commons/testrenderer.h index 20ab032b1..327e08d78 100644 --- a/tests/auto/render/commons/testrenderer.h +++ b/tests/auto/render/commons/testrenderer.h @@ -39,46 +39,46 @@ public: TestRenderer(); ~TestRenderer(); - void dumpInfo() const Q_DECL_OVERRIDE {} - API api() const Q_DECL_OVERRIDE { return AbstractRenderer::OpenGL; } - qint64 time() const Q_DECL_OVERRIDE { return 0; } - void setTime(qint64 time) Q_DECL_OVERRIDE { Q_UNUSED(time); } - void setNodeManagers(Qt3DRender::Render::NodeManagers *m) Q_DECL_OVERRIDE { m_managers = m; } - void setServices(Qt3DCore::QServiceLocator *services) Q_DECL_OVERRIDE { Q_UNUSED(services); } - void setSurfaceExposed(bool exposed) Q_DECL_OVERRIDE { Q_UNUSED(exposed); } - Qt3DRender::Render::NodeManagers *nodeManagers() const Q_DECL_OVERRIDE { return m_managers; } - Qt3DCore::QServiceLocator *services() const Q_DECL_OVERRIDE { return nullptr; } - void initialize() Q_DECL_OVERRIDE {} - void shutdown() Q_DECL_OVERRIDE {} - void releaseGraphicsResources() Q_DECL_OVERRIDE {} - void render() Q_DECL_OVERRIDE {} - void doRender(bool scene3dBlocking = false) Q_DECL_OVERRIDE { Q_UNUSED(scene3dBlocking); } - void cleanGraphicsResources() Q_DECL_OVERRIDE {} - bool isRunning() const Q_DECL_OVERRIDE { return true; } - bool shouldRender() Q_DECL_OVERRIDE { return true; } - void skipNextFrame() Q_DECL_OVERRIDE {} - QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() Q_DECL_OVERRIDE { return QVector<Qt3DCore::QAspectJobPtr>(); } - Qt3DCore::QAspectJobPtr pickBoundingVolumeJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); } - Qt3DCore::QAspectJobPtr syncTextureLoadingJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); } - Qt3DCore::QAspectJobPtr expandBoundingVolumeJob() Q_DECL_OVERRIDE { return Qt3DCore::QAspectJobPtr(); } - void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Qt3DRender::Render::Entity *root) Q_DECL_OVERRIDE { Q_UNUSED(factory); Q_UNUSED(root); } - Qt3DRender::Render::Entity *sceneRoot() const Q_DECL_OVERRIDE { return nullptr; } - Qt3DRender::Render::FrameGraphNode *frameGraphRoot() const Q_DECL_OVERRIDE { return nullptr; } - Qt3DCore::QAbstractFrameAdvanceService *frameAdvanceService() const Q_DECL_OVERRIDE { return nullptr; } - void registerEventFilter(Qt3DCore::QEventFilterService *service) Q_DECL_OVERRIDE { Q_UNUSED(service); } - void setSettings(Qt3DRender::Render::RenderSettings *settings) Q_DECL_OVERRIDE { Q_UNUSED(settings); } - Qt3DRender::Render::RenderSettings *settings() const Q_DECL_OVERRIDE { return nullptr; } + void dumpInfo() const override {} + API api() const override { return AbstractRenderer::OpenGL; } + qint64 time() const override { return 0; } + void setTime(qint64 time) override { Q_UNUSED(time); } + void setNodeManagers(Qt3DRender::Render::NodeManagers *m) override { m_managers = m; } + void setServices(Qt3DCore::QServiceLocator *services) override { Q_UNUSED(services); } + void setSurfaceExposed(bool exposed) override { Q_UNUSED(exposed); } + Qt3DRender::Render::NodeManagers *nodeManagers() const override { return m_managers; } + Qt3DCore::QServiceLocator *services() const override { return nullptr; } + void initialize() override {} + void shutdown() override {} + void releaseGraphicsResources() override {} + void render() override {} + void doRender(bool scene3dBlocking = false) override { Q_UNUSED(scene3dBlocking); } + void cleanGraphicsResources() override {} + bool isRunning() const override { return true; } + bool shouldRender() override { return true; } + void skipNextFrame() override {} + QVector<Qt3DCore::QAspectJobPtr> renderBinJobs() override { return QVector<Qt3DCore::QAspectJobPtr>(); } + Qt3DCore::QAspectJobPtr pickBoundingVolumeJob() override { return Qt3DCore::QAspectJobPtr(); } + Qt3DCore::QAspectJobPtr syncTextureLoadingJob() override { return Qt3DCore::QAspectJobPtr(); } + Qt3DCore::QAspectJobPtr expandBoundingVolumeJob() override { return Qt3DCore::QAspectJobPtr(); } + void setSceneRoot(Qt3DCore::QBackendNodeFactory *factory, Qt3DRender::Render::Entity *root) override { Q_UNUSED(factory); Q_UNUSED(root); } + Qt3DRender::Render::Entity *sceneRoot() const override { return nullptr; } + Qt3DRender::Render::FrameGraphNode *frameGraphRoot() const override { return nullptr; } + Qt3DCore::QAbstractFrameAdvanceService *frameAdvanceService() const override { return nullptr; } + void registerEventFilter(Qt3DCore::QEventFilterService *service) override { Q_UNUSED(service); } + void setSettings(Qt3DRender::Render::RenderSettings *settings) override { Q_UNUSED(settings); } + Qt3DRender::Render::RenderSettings *settings() const override { return nullptr; } - void markDirty(Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet changes, Qt3DRender::Render::BackendNode *node) Q_DECL_OVERRIDE; - Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet dirtyBits() Q_DECL_OVERRIDE; - void clearDirtyBits(Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet changes) Q_DECL_OVERRIDE; + void markDirty(Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet changes, Qt3DRender::Render::BackendNode *node) override; + Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet dirtyBits() override; + void clearDirtyBits(Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet changes) override; void resetDirty(); - QVariant executeCommand(const QStringList &args) Q_DECL_OVERRIDE; - QOpenGLContext *shareContext() const Q_DECL_OVERRIDE; + QVariant executeCommand(const QStringList &args) override; + QOpenGLContext *shareContext() const override; - void setOffscreenSurfaceHelper(Qt3DRender::Render::OffscreenSurfaceHelper *helper) Q_DECL_OVERRIDE; - QSurfaceFormat format() Q_DECL_OVERRIDE; + void setOffscreenSurfaceHelper(Qt3DRender::Render::OffscreenSurfaceHelper *helper) override; + QSurfaceFormat format() override; protected: Qt3DRender::Render::AbstractRenderer::BackendNodeDirtySet m_changes; diff --git a/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp b/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp index af074def0..d07ec9914 100644 --- a/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp +++ b/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp @@ -44,12 +44,12 @@ public: : m_size(size) {} - Qt3DRender::QGeometry *operator ()() Q_DECL_FINAL + Qt3DRender::QGeometry *operator ()() final { return nullptr; } - bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_FINAL + bool operator ==(const Qt3DRender::QGeometryFactory &other) const final { const TestFactory *otherFactory = Qt3DRender::functor_cast<TestFactory>(&other); if (otherFactory != nullptr) diff --git a/tests/auto/render/loadscenejob/tst_loadscenejob.cpp b/tests/auto/render/loadscenejob/tst_loadscenejob.cpp index bd9848928..946a3f305 100644 --- a/tests/auto/render/loadscenejob/tst_loadscenejob.cpp +++ b/tests/auto/render/loadscenejob/tst_loadscenejob.cpp @@ -45,29 +45,29 @@ public: , m_shouldFail(shouldFail) {} - void setSource(const QUrl &source) Q_DECL_OVERRIDE + void setSource(const QUrl &source) override { m_source = source; } - void setData(const QByteArray& data, const QString &basePath) Q_DECL_OVERRIDE + void setData(const QByteArray& data, const QString &basePath) override { Q_UNUSED(data); Q_UNUSED(basePath); } - bool areFileTypesSupported(const QStringList &extensions) const Q_DECL_OVERRIDE + bool areFileTypesSupported(const QStringList &extensions) const override { Q_UNUSED(extensions); return m_supportsFormat; } - Qt3DCore::QEntity *scene(const QString &) Q_DECL_OVERRIDE + Qt3DCore::QEntity *scene(const QString &) override { return m_shouldFail ? nullptr : new Qt3DCore::QEntity(); } - Qt3DCore::QEntity *node(const QString &) Q_DECL_OVERRIDE + Qt3DCore::QEntity *node(const QString &) override { return m_shouldFail ? nullptr : new Qt3DCore::QEntity(); } diff --git a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp index 3b6089830..1142d1447 100644 --- a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp +++ b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp @@ -43,12 +43,12 @@ public: ~MeshFunctorA() {} - Qt3DRender::QGeometry *operator ()() Q_DECL_OVERRIDE + Qt3DRender::QGeometry *operator ()() override { return nullptr; } - bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_OVERRIDE + bool operator ==(const Qt3DRender::QGeometryFactory &other) const override { return Qt3DRender::functor_cast<MeshFunctorA>(&other); } @@ -65,12 +65,12 @@ public: ~MeshFunctorB() {} - Qt3DRender::QGeometry *operator ()() Q_DECL_OVERRIDE + Qt3DRender::QGeometry *operator ()() override { return nullptr; } - bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_OVERRIDE + bool operator ==(const Qt3DRender::QGeometryFactory &other) const override { return Qt3DRender::functor_cast<MeshFunctorB>(&other); } @@ -87,7 +87,7 @@ public: ~MeshFunctorASub() {} - bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_OVERRIDE + bool operator ==(const Qt3DRender::QGeometryFactory &other) const override { return Qt3DRender::functor_cast<MeshFunctorASub>(&other); } @@ -116,6 +116,7 @@ private Q_SLOTS: QVERIFY(functor.sourceData().isEmpty()); QCOMPARE(functor.mesh(), mesh.id()); QCOMPARE(functor.sourcePath(), mesh.source()); + QCOMPARE(functor.status(), Qt3DRender::QMesh::None); } void functorComparison() @@ -189,6 +190,7 @@ private Q_SLOTS: // THEN QVERIFY(g == nullptr); + QCOMPARE(functor.status(), Qt3DRender::QMesh::Error); } { @@ -202,6 +204,7 @@ private Q_SLOTS: // THEN QVERIFY(g == nullptr); + QCOMPARE(functor.status(), Qt3DRender::QMesh::Error); } { @@ -215,6 +218,7 @@ private Q_SLOTS: // THEN QVERIFY(g == nullptr); + QCOMPARE(functor.status(), Qt3DRender::QMesh::Error); } } }; diff --git a/tests/auto/render/picking/tst_picking.cpp b/tests/auto/render/picking/tst_picking.cpp index b4aa39545..47027bf56 100644 --- a/tests/auto/render/picking/tst_picking.cpp +++ b/tests/auto/render/picking/tst_picking.cpp @@ -54,7 +54,7 @@ public: : Qt3DRender::QObjectPicker(parent) {} - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_FINAL + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) final { Qt3DRender::QObjectPicker::sceneChangeEvent(change); } diff --git a/tests/auto/render/qabstracttexture/tst_qabstracttexture.cpp b/tests/auto/render/qabstracttexture/tst_qabstracttexture.cpp index 4047cc32d..c7158f4de 100644 --- a/tests/auto/render/qabstracttexture/tst_qabstracttexture.cpp +++ b/tests/auto/render/qabstracttexture/tst_qabstracttexture.cpp @@ -47,7 +47,7 @@ class FakeTexture : public Qt3DRender::QAbstractTexture class FakeTextureImage : public Qt3DRender::QAbstractTextureImage { protected: - Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const Q_DECL_OVERRIDE + Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const override { return Qt3DRender::QTextureImageDataGeneratorPtr(); } diff --git a/tests/auto/render/qabstracttextureimage/tst_qabstracttextureimage.cpp b/tests/auto/render/qabstracttextureimage/tst_qabstracttextureimage.cpp index 5875cb9fc..05029450a 100644 --- a/tests/auto/render/qabstracttextureimage/tst_qabstracttextureimage.cpp +++ b/tests/auto/render/qabstracttextureimage/tst_qabstracttextureimage.cpp @@ -40,7 +40,7 @@ class FakeTextureImage : public Qt3DRender::QAbstractTextureImage { protected: - Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const Q_DECL_OVERRIDE + Qt3DRender::QTextureImageDataGeneratorPtr dataGenerator() const override { return Qt3DRender::QTextureImageDataGeneratorPtr(); } diff --git a/tests/auto/render/qboundingvolumedebug/tst_qboundingvolumedebug.cpp b/tests/auto/render/qboundingvolumedebug/tst_qboundingvolumedebug.cpp index 5a37d98a1..2f2ce50f7 100644 --- a/tests/auto/render/qboundingvolumedebug/tst_qboundingvolumedebug.cpp +++ b/tests/auto/render/qboundingvolumedebug/tst_qboundingvolumedebug.cpp @@ -41,11 +41,11 @@ class MyBoundingVolumeDebug : public Qt3DRender::QBoundingVolumeDebug { Q_OBJECT public: - MyBoundingVolumeDebug(Qt3DCore::QNode *parent = Q_NULLPTR) + MyBoundingVolumeDebug(Qt3DCore::QNode *parent = nullptr) : Qt3DRender::QBoundingVolumeDebug(parent) {} - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_FINAL + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) final { Qt3DRender::QBoundingVolumeDebug::sceneChangeEvent(change); } @@ -94,7 +94,7 @@ private Q_SLOTS: // QCoreApplication::processEvents(); // // THEN -// QVERIFY(clone != Q_NULLPTR); +// QVERIFY(clone != nullptr); // QCOMPARE(bvD->id(), clone->id()); // QCOMPARE(bvD->recursive(), clone->recursive()); // } diff --git a/tests/auto/render/qbuffer/tst_qbuffer.cpp b/tests/auto/render/qbuffer/tst_qbuffer.cpp index 719c6229f..c0d96d10b 100644 --- a/tests/auto/render/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/render/qbuffer/tst_qbuffer.cpp @@ -44,12 +44,12 @@ public: : m_size(size) {} - QByteArray operator ()() Q_DECL_FINAL + QByteArray operator ()() final { return QByteArray(); } - bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const Q_DECL_FINAL + bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const final { const TestFunctor *otherFunctor = Qt3DRender::functor_cast<TestFunctor>(&other); if (otherFunctor != nullptr) diff --git a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp index edd767ad9..221d0f880 100644 --- a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp +++ b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp @@ -51,12 +51,12 @@ public: : m_size(size) {} - Qt3DRender::QGeometry *operator ()() Q_DECL_FINAL + Qt3DRender::QGeometry *operator ()() final { return nullptr; } - bool operator ==(const Qt3DRender::QGeometryFactory &other) const Q_DECL_FINAL + bool operator ==(const Qt3DRender::QGeometryFactory &other) const final { const TestFactory *otherFactory = Qt3DRender::functor_cast<TestFactory>(&other); if (otherFactory != nullptr) diff --git a/tests/auto/render/qmesh/tst_qmesh.cpp b/tests/auto/render/qmesh/tst_qmesh.cpp index e12c61339..fbc566395 100644 --- a/tests/auto/render/qmesh/tst_qmesh.cpp +++ b/tests/auto/render/qmesh/tst_qmesh.cpp @@ -38,6 +38,20 @@ #include <Qt3DCore/qnodecreatedchange.h> #include "testpostmanarbiter.h" +class MyQMesh : public Qt3DRender::QMesh +{ + Q_OBJECT +public: + explicit MyQMesh(Qt3DCore::QNode *parent = nullptr) + : Qt3DRender::QMesh(parent) + {} + + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) final + { + Qt3DRender::QMesh::sceneChangeEvent(change); + } +}; + class tst_QMesh : public QObject { Q_OBJECT @@ -52,6 +66,7 @@ private Q_SLOTS: // THEN QCOMPARE(mesh.source(), QUrl()); QCOMPARE(mesh.meshName(), QString()); + QCOMPARE(mesh.status(), Qt3DRender::QMesh::None); } void checkPropertyChanges() @@ -241,6 +256,28 @@ private Q_SLOTS: } + void checkStatusUpdate() + { + // GIVEN + qRegisterMetaType<Qt3DRender::QMesh::Status>("Status"); + MyQMesh mesh; + QSignalSpy spy(&mesh, SIGNAL(statusChanged(Status))); + + // THEN + QCOMPARE(mesh.status(), Qt3DRender::QMesh::None); + + // WHEN + const Qt3DRender::QMesh::Status newStatus = Qt3DRender::QMesh::Error; + Qt3DCore::QPropertyUpdatedChangePtr e(new Qt3DCore::QPropertyUpdatedChange(mesh.id())); + e->setPropertyName("status"); + e->setValue(QVariant::fromValue(newStatus)); + mesh.sceneChangeEvent(e); + + // THEN + QCOMPARE(mesh.status(), newStatus); + QCOMPARE(spy.count(), 1); + } + void checkGeometryFactoryIsAccessibleEvenWithNoScene() // QTBUG-65506 { // GIVEN diff --git a/tests/auto/render/qobjectpicker/tst_qobjectpicker.cpp b/tests/auto/render/qobjectpicker/tst_qobjectpicker.cpp index 4397954ec..6714d8a06 100644 --- a/tests/auto/render/qobjectpicker/tst_qobjectpicker.cpp +++ b/tests/auto/render/qobjectpicker/tst_qobjectpicker.cpp @@ -43,7 +43,7 @@ public: : Qt3DRender::QObjectPicker(parent) {} - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_FINAL + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) final { Qt3DRender::QObjectPicker::sceneChangeEvent(change); } diff --git a/tests/auto/render/qrendercapture/tst_qrendercapture.cpp b/tests/auto/render/qrendercapture/tst_qrendercapture.cpp index 830615a95..b2144d500 100644 --- a/tests/auto/render/qrendercapture/tst_qrendercapture.cpp +++ b/tests/auto/render/qrendercapture/tst_qrendercapture.cpp @@ -44,7 +44,7 @@ public: : Qt3DRender::QRenderCapture(parent) {} - void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_FINAL + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) final { Qt3DRender::QRenderCapture::sceneChangeEvent(change); } diff --git a/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp b/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp index b4328815f..477acc058 100644 --- a/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp +++ b/tests/auto/render/qsortpolicy/tst_qsortpolicy.cpp @@ -64,7 +64,8 @@ private Q_SLOTS: Qt3DRender::QSortPolicy *sortPolicyWithSortTypes = new Qt3DRender::QSortPolicy(); auto sortTypes = QVector<Qt3DRender::QSortPolicy::SortType>() << Qt3DRender::QSortPolicy::BackToFront - << Qt3DRender::QSortPolicy::Material; + << Qt3DRender::QSortPolicy::Material + << Qt3DRender::QSortPolicy::FrontToBack; sortPolicyWithSortTypes->setSortTypes(sortTypes); QTest::newRow("sortPolicyWithSortTypes") << sortPolicyWithSortTypes << sortTypes ; } @@ -108,7 +109,8 @@ private Q_SLOTS: // WHEN auto sortTypes = QVector<Qt3DRender::QSortPolicy::SortType>() << Qt3DRender::QSortPolicy::BackToFront << Qt3DRender::QSortPolicy::Material - << Qt3DRender::QSortPolicy::Material; + << Qt3DRender::QSortPolicy::Material + << Qt3DRender::QSortPolicy::FrontToBack; auto sortTypesInt = QVector<int>(); transformVector(sortTypes, sortTypesInt); sortPolicy->setSortTypes(sortTypes); diff --git a/tests/auto/render/qtextureimagedata/tst_qtextureimagedata.cpp b/tests/auto/render/qtextureimagedata/tst_qtextureimagedata.cpp index dd931dabf..dec816a5e 100644 --- a/tests/auto/render/qtextureimagedata/tst_qtextureimagedata.cpp +++ b/tests/auto/render/qtextureimagedata/tst_qtextureimagedata.cpp @@ -76,9 +76,9 @@ private Q_SLOTS: /* protected: - Qt3DCore::QNode *doClone() const Q_DECL_OVERRIDE + Qt3DCore::QNode *doClone() const override { - return Q_NULLPTR; + return nullptr; } */ diff --git a/tests/auto/render/renderer/tst_renderer.cpp b/tests/auto/render/renderer/tst_renderer.cpp index 85d978926..a2ea993e8 100644 --- a/tests/auto/render/renderer/tst_renderer.cpp +++ b/tests/auto/render/renderer/tst_renderer.cpp @@ -60,7 +60,7 @@ private Q_SLOTS: renderer.setSettings(&settings); renderer.initialize(); - const int singleRenderViewJobCount = 11 + 2 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount(); + const int singleRenderViewJobCount = 11 + 1 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount(); // RenderViewBuilder renderViewJob, // renderableEntityFilterJob, // lightGatherJob, diff --git a/tests/auto/render/renderqueue/tst_renderqueue.cpp b/tests/auto/render/renderqueue/tst_renderqueue.cpp index 163a699c1..071f9b3a5 100644 --- a/tests/auto/render/renderqueue/tst_renderqueue.cpp +++ b/tests/auto/render/renderqueue/tst_renderqueue.cpp @@ -148,7 +148,7 @@ public: public Q_SLOTS: - void run() Q_DECL_FINAL // In Thread + void run() final // In Thread { for (int i = 0; i < 5; i++) { m_waitQueue.acquire(); diff --git a/tests/auto/render/renderviewbuilder/tst_renderviewbuilder.cpp b/tests/auto/render/renderviewbuilder/tst_renderviewbuilder.cpp index 21e2e2639..d18b270c5 100644 --- a/tests/auto/render/renderviewbuilder/tst_renderviewbuilder.cpp +++ b/tests/auto/render/renderviewbuilder/tst_renderviewbuilder.cpp @@ -187,6 +187,7 @@ private Q_SLOTS: QCOMPARE(renderViewBuilder.renderViewIndex(), 0); QCOMPARE(renderViewBuilder.renderer(), testAspect.renderer()); QCOMPARE(renderViewBuilder.layerCacheNeedsToBeRebuilt(), false); + QCOMPARE(renderViewBuilder.materialGathererCacheNeedsToBeRebuilt(), false); QVERIFY(!renderViewBuilder.renderViewJob().isNull()); QVERIFY(!renderViewBuilder.lightGathererJob().isNull()); QVERIFY(!renderViewBuilder.renderableEntityFilterJob().isNull()); @@ -215,8 +216,8 @@ private Q_SLOTS: QVERIFY(renderViewBuilder.syncFilterEntityByLayerJob().isNull()); QCOMPARE(renderViewBuilder.renderViewBuilderJobs().size(), Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); - QCOMPARE(renderViewBuilder.materialGathererJobs().size(), Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); - QCOMPARE(renderViewBuilder.buildJobHierachy().size(), 11 + 2 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); + QCOMPARE(renderViewBuilder.materialGathererJobs().size(), 0); + QCOMPARE(renderViewBuilder.buildJobHierachy().size(), 11 + 1 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); } { @@ -231,7 +232,22 @@ private Q_SLOTS: QVERIFY(!renderViewBuilder.syncFilterEntityByLayerJob().isNull()); // mark jobs dirty and recheck - QCOMPARE(renderViewBuilder.buildJobHierachy().size(), 13 + 2 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); + QCOMPARE(renderViewBuilder.buildJobHierachy().size(), 13 + 1 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); + } + + { + // WHEN + Qt3DRender::Render::RenderViewBuilder renderViewBuilder(leafNode, 0, testAspect.renderer()); + renderViewBuilder.setMaterialGathererCacheNeedsToBeRebuilt(true); + renderViewBuilder.prepareJobs(); + + // THEN + QCOMPARE(renderViewBuilder.materialGathererCacheNeedsToBeRebuilt(), true); + QCOMPARE(renderViewBuilder.materialGathererJobs().size(), Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); + QVERIFY(!renderViewBuilder.syncMaterialGathererJob().isNull()); + + // mark jobs dirty and recheck + QCOMPARE(renderViewBuilder.buildJobHierachy().size(), 12 + 2 * Qt3DRender::Render::RenderViewBuilder::optimalJobCount()); } } diff --git a/tests/auto/render/renderviews/tst_renderviews.cpp b/tests/auto/render/renderviews/tst_renderviews.cpp index 2c8486ed0..d941126e2 100644 --- a/tests/auto/render/renderviews/tst_renderviews.cpp +++ b/tests/auto/render/renderviews/tst_renderviews.cpp @@ -205,6 +205,35 @@ private Q_SLOTS: // RenderCommands are deleted by RenderView dtor } + void checkRenderCommandFrontToBackSorting() + { + // GIVEN + RenderView renderView; + QVector<RenderCommand *> rawCommands; + QVector<QSortPolicy::SortType> sortTypes; + + sortTypes.push_back(QSortPolicy::FrontToBack); + + for (int i = 0; i < 200; ++i) { + RenderCommand *c = new RenderCommand(); + c->m_depth = float(i); + rawCommands.push_back(c); + } + + // WHEN + renderView.addSortType(sortTypes); + renderView.setCommands(rawCommands); + renderView.sort(); + + // THEN + const QVector<RenderCommand *> sortedCommands = renderView.commands(); + QCOMPARE(rawCommands.size(), sortedCommands.size()); + for (int j = 1; j < sortedCommands.size(); ++j) + QVERIFY(sortedCommands.at(j - 1)->m_depth < sortedCommands.at(j)->m_depth); + + // RenderCommands are deleted by RenderView dtor + } + void checkRenderCommandStateCostSorting() { // GIVEN diff --git a/tests/auto/render/renderviewutils/tst_renderviewutils.cpp b/tests/auto/render/renderviewutils/tst_renderviewutils.cpp index fa0dce6af..81d0ee4a2 100644 --- a/tests/auto/render/renderviewutils/tst_renderviewutils.cpp +++ b/tests/auto/render/renderviewutils/tst_renderviewutils.cpp @@ -296,7 +296,7 @@ public: return m_inner; } - QHash<QString, Qt3DRender::Render::ShaderUniform> buildUniformMap(const QString &blockName) Q_DECL_OVERRIDE + QHash<QString, Qt3DRender::Render::ShaderUniform> buildUniformMap(const QString &blockName) override { QHash<QString, Qt3DRender::Render::ShaderUniform> innerUniforms; @@ -315,7 +315,7 @@ public: return uniforms; } - QHash<QString, QVariant> buildUniformMapValues(const QString &blockName) Q_DECL_OVERRIDE + QHash<QString, QVariant> buildUniformMapValues(const QString &blockName) override { QHash<QString, QVariant> innerUniformsValues; diff --git a/tests/auto/render/scene2d/tst_scene2d.cpp b/tests/auto/render/scene2d/tst_scene2d.cpp index a78ed0ab1..c30400202 100644 --- a/tests/auto/render/scene2d/tst_scene2d.cpp +++ b/tests/auto/render/scene2d/tst_scene2d.cpp @@ -62,7 +62,7 @@ public: } - bool event(QEvent *e) Q_DECL_OVERRIDE + bool event(QEvent *e) override { if (e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove) { diff --git a/tests/auto/render/textures/tst_textures.cpp b/tests/auto/render/textures/tst_textures.cpp index 82c638275..8005e998a 100644 --- a/tests/auto/render/textures/tst_textures.cpp +++ b/tests/auto/render/textures/tst_textures.cpp @@ -52,13 +52,13 @@ class TestImageDataGenerator : public Qt3DRender::QTextureImageDataGenerator public: TestImageDataGenerator(int id) : m_id(id) {} - Qt3DRender::QTextureImageDataPtr operator ()() Q_DECL_OVERRIDE { + Qt3DRender::QTextureImageDataPtr operator ()() override { return Qt3DRender::QTextureImageDataPtr::create(); } - bool operator ==(const Qt3DRender::QTextureImageDataGenerator &other) const Q_DECL_OVERRIDE { + bool operator ==(const Qt3DRender::QTextureImageDataGenerator &other) const override { const TestImageDataGenerator *otherFunctor = Qt3DRender::functor_cast<TestImageDataGenerator>(&other); - return (otherFunctor != Q_NULLPTR && otherFunctor->m_id == m_id); + return (otherFunctor != nullptr && otherFunctor->m_id == m_id); } QT3D_FUNCTOR(TestImageDataGenerator) @@ -73,13 +73,13 @@ class TestTextureGenerator : public Qt3DRender::QTextureGenerator public: TestTextureGenerator(int id) : m_id(id) {} - Qt3DRender::QTextureDataPtr operator ()() Q_DECL_OVERRIDE { + Qt3DRender::QTextureDataPtr operator ()() override { return Qt3DRender::QTextureDataPtr::create(); } - bool operator ==(const Qt3DRender::QTextureGenerator &other) const Q_DECL_OVERRIDE { + bool operator ==(const Qt3DRender::QTextureGenerator &other) const override { const TestTextureGenerator *otherFunctor = Qt3DRender::functor_cast<TestTextureGenerator>(&other); - return (otherFunctor != Q_NULLPTR && otherFunctor->m_id == m_id); + return (otherFunctor != nullptr && otherFunctor->m_id == m_id); } QT3D_FUNCTOR(TestTextureGenerator) diff --git a/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp b/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp index c35473111..1238f1800 100644 --- a/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp +++ b/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp @@ -30,7 +30,7 @@ #include <Qt3DRender/private/vsyncframeadvanceservice_p.h> -class FakeRenderThread Q_DECL_FINAL : public QThread +class FakeRenderThread final : public QThread { public: FakeRenderThread(Qt3DRender::Render::VSyncFrameAdvanceService *tickService) @@ -55,7 +55,7 @@ public: protected: // QThread interface - void run() Q_DECL_FINAL + void run() final { m_tickService->proceedToNextFrame(); diff --git a/tests/manual/downloading/main.qml b/tests/manual/downloading/main.qml index 47d1c09fb..1dbbc3e5c 100644 --- a/tests/manual/downloading/main.qml +++ b/tests/manual/downloading/main.qml @@ -82,6 +82,7 @@ Entity { Mesh { id: mesh source: "https://codereview.qt-project.org/gitweb?p=qt/qt3d.git;a=blob_plain;hb=refs/heads/dev;f=examples/qt3d/exampleresources/assets/chest/Chest.obj" + onStatusChanged: console.log("Status " + status) } Transform { |