From febb1f721f720bb9f32bb60c711f709faadb366a Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 8 Dec 2016 01:53:14 +0300 Subject: sources: Add missing override and remove redundant virtual Change-Id: I48e26b1491024d41ebf75d40f0d1a7e9a1b20f22 Reviewed-by: Anton Kudryavtsev Reviewed-by: Marc Mutz Reviewed-by: Shawn Rutledge --- src/particles/qquickimageparticle.cpp | 58 ++++++++++----------- .../qmldbg_local/qlocalclientconnection.cpp | 14 ++--- .../qmltooling/qmldbg_server/qqmldebugserver.cpp | 2 +- .../qmltooling/qmldbg_tcp/qtcpserverconnection.cpp | 14 ++--- src/qml/jit/qv4assembler.cpp | 4 +- src/qml/qml/qqmlengine.cpp | 2 +- src/qml/types/qquickpackage.cpp | 2 +- src/qml/util/qqmladaptormodel.cpp | 60 +++++++++++----------- src/quick/items/qquickpositioners.cpp | 6 +-- .../software/qsgsoftwarepixmaprenderer.cpp | 2 +- .../adaptations/software/qsgsoftwarerenderer.cpp | 2 +- .../software/qsgsoftwarethreadedrenderloop.cpp | 4 +- src/quick/scenegraph/coreapi/qsgrenderer.cpp | 2 +- src/quick/scenegraph/qsgdefaultcontext.cpp | 4 +- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 20 ++++---- .../scenegraph/qsgdefaultinternalimagenode.cpp | 6 +-- .../scenegraph/qsgdefaultinternalrectanglenode.cpp | 6 +-- .../scenegraph/qsgdistancefieldglyphnode_p.cpp | 26 +++++----- src/quick/scenegraph/qsgrenderloop.cpp | 24 ++++----- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 4 +- src/quick/scenegraph/util/qsgflatcolormaterial.cpp | 6 +-- .../scenegraph/util/qsgvertexcolormaterial.cpp | 6 +-- src/quick/util/qquickglobal.cpp | 26 +++++----- src/quick/util/qquickpixmapcache.cpp | 4 +- 24 files changed, 152 insertions(+), 152 deletions(-) (limited to 'src') diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index ccfebddb0e..fde491b1ef 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -118,15 +118,15 @@ public: Q_ASSERT(!m_fragment_code.isNull()); } - const char *vertexShader() const { return m_vertex_code.constData(); } - const char *fragmentShader() const { return m_fragment_code.constData(); } + const char *vertexShader() const override { return m_vertex_code.constData(); } + const char *fragmentShader() const override { return m_fragment_code.constData(); } - QList attributes() const { + QList attributes() const override { return QList() << "vPosTex" << "vData" << "vVec" << "vColor" << "vDeformVec" << "vRotation"; }; - void initialize() { + void initialize() override { QSGSimpleMaterialShader::initialize(); program()->bind(); program()->setUniformValue("_qt_texture", 0); @@ -138,7 +138,7 @@ public: m_opacitytable_id = program()->uniformLocation("opacitytable"); } - void updateState(const TabledMaterialData* d, const TabledMaterialData*) { + void updateState(const TabledMaterialData* d, const TabledMaterialData*) override { glFuncs->glActiveTexture(GL_TEXTURE1); d->colorTable->bind(); @@ -192,15 +192,15 @@ public: Q_ASSERT(!m_fragment_code.isNull()); } - const char *vertexShader() const { return m_vertex_code.constData(); } - const char *fragmentShader() const { return m_fragment_code.constData(); } + const char *vertexShader() const override { return m_vertex_code.constData(); } + const char *fragmentShader() const override { return m_fragment_code.constData(); } - QList attributes() const { + QList attributes() const override { return QList() << "vPosTex" << "vData" << "vVec" << "vColor" << "vDeformVec" << "vRotation"; }; - void initialize() { + void initialize() override { QSGSimpleMaterialShader::initialize(); program()->bind(); program()->setUniformValue("_qt_texture", 0); @@ -209,7 +209,7 @@ public: m_entry_id = program()->uniformLocation("entry"); } - void updateState(const DeformableMaterialData* d, const DeformableMaterialData*) { + void updateState(const DeformableMaterialData* d, const DeformableMaterialData*) override { d->texture->bind(); program()->setUniformValue(m_timestamp_id, (float) d->timestamp); @@ -259,15 +259,15 @@ public: Q_ASSERT(!m_fragment_code.isNull()); } - const char *vertexShader() const { return m_vertex_code.constData(); } - const char *fragmentShader() const { return m_fragment_code.constData(); } + const char *vertexShader() const override { return m_vertex_code.constData(); } + const char *fragmentShader() const override { return m_fragment_code.constData(); } - QList attributes() const { + QList attributes() const override { return QList() << "vPosTex" << "vData" << "vVec" << "vColor" << "vDeformVec" << "vRotation" << "vAnimData" << "vAnimPos"; } - void initialize() { + void initialize() override { QSGSimpleMaterialShader::initialize(); program()->bind(); program()->setUniformValue("_qt_texture", 0); @@ -280,7 +280,7 @@ public: m_opacitytable_id = program()->uniformLocation("opacitytable"); } - void updateState(const SpriteMaterialData* d, const SpriteMaterialData*) { + void updateState(const SpriteMaterialData* d, const SpriteMaterialData*) override { glFuncs->glActiveTexture(GL_TEXTURE1); d->colorTable->bind(); @@ -333,10 +333,10 @@ public: Q_ASSERT(!m_fragment_code.isNull()); } - const char *vertexShader() const { return m_vertex_code.constData(); } - const char *fragmentShader() const { return m_fragment_code.constData(); } + const char *vertexShader() const override { return m_vertex_code.constData(); } + const char *fragmentShader() const override { return m_fragment_code.constData(); } - void activate() { + void activate() override { QSGSimpleMaterialShader::activate(); #if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glEnable(GL_POINT_SPRITE); @@ -344,7 +344,7 @@ public: #endif } - void deactivate() { + void deactivate() override { QSGSimpleMaterialShader::deactivate(); #if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glDisable(GL_POINT_SPRITE); @@ -352,11 +352,11 @@ public: #endif } - QList attributes() const { + QList attributes() const override { return QList() << "vPos" << "vData" << "vVec" << "vColor"; } - void initialize() { + void initialize() override { QSGSimpleMaterialShader::initialize(); program()->bind(); program()->setUniformValue("_qt_texture", 0); @@ -365,7 +365,7 @@ public: m_entry_id = program()->uniformLocation("entry"); } - void updateState(const ColoredMaterialData* d, const ColoredMaterialData*) { + void updateState(const ColoredMaterialData* d, const ColoredMaterialData*) override { d->texture->bind(); program()->setUniformValue(m_timestamp_id, (float) d->timestamp); @@ -407,10 +407,10 @@ public: Q_ASSERT(!m_fragment_code.isNull()); } - const char *vertexShader() const { return m_vertex_code.constData(); } - const char *fragmentShader() const { return m_fragment_code.constData(); } + const char *vertexShader() const override { return m_vertex_code.constData(); } + const char *fragmentShader() const override { return m_fragment_code.constData(); } - void activate() { + void activate() override { QSGSimpleMaterialShader::activate(); #if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glEnable(GL_POINT_SPRITE); @@ -418,7 +418,7 @@ public: #endif } - void deactivate() { + void deactivate() override { QSGSimpleMaterialShader::deactivate(); #if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) glDisable(GL_POINT_SPRITE); @@ -426,11 +426,11 @@ public: #endif } - QList attributes() const { + QList attributes() const override { return QList() << "vPos" << "vData" << "vVec"; } - void initialize() { + void initialize() override { QSGSimpleMaterialShader::initialize(); program()->bind(); program()->setUniformValue("_qt_texture", 0); @@ -439,7 +439,7 @@ public: m_entry_id = program()->uniformLocation("entry"); } - void updateState(const SimpleMaterialData* d, const SimpleMaterialData*) { + void updateState(const SimpleMaterialData* d, const SimpleMaterialData*) override { d->texture->bind(); program()->setUniformValue(m_timestamp_id, (float) d->timestamp); diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp index 6152853917..97e4b4e3e4 100644 --- a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp @@ -57,15 +57,15 @@ public: QLocalClientConnection(); ~QLocalClientConnection(); - void setServer(QQmlDebugServer *server); - bool setPortRange(int portFrom, int portTo, bool block, const QString &hostaddress); - bool setFileName(const QString &filename, bool block); + void setServer(QQmlDebugServer *server) override; + bool setPortRange(int portFrom, int portTo, bool block, const QString &hostaddress) override; + bool setFileName(const QString &filename, bool block) override; - bool isConnected() const; - void disconnect(); + bool isConnected() const override; + void disconnect() override; - void waitForConnection(); - void flush(); + void waitForConnection() override; + void flush() override; private: void connectionEstablished(); diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp index f6f48e43a4..bcfb3b8a75 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp @@ -114,7 +114,7 @@ public: return m_pluginName; } - void run(); + void run() override; private: QQmlDebugServerImpl *m_server; diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp index b305c3f535..af4f5292ba 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp @@ -55,15 +55,15 @@ public: QTcpServerConnection(); ~QTcpServerConnection(); - void setServer(QQmlDebugServer *server); - bool setPortRange(int portFrom, int portTo, bool block, const QString &hostaddress); - bool setFileName(const QString &fileName, bool block); + void setServer(QQmlDebugServer *server) override; + bool setPortRange(int portFrom, int portTo, bool block, const QString &hostaddress) override; + bool setFileName(const QString &fileName, bool block) override; - bool isConnected() const; - void disconnect(); + bool isConnected() const override; + void disconnect() override; - void waitForConnection(); - void flush(); + void waitForConnection() override; + void flush() override; private: void newConnection(); diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp index a2cb56abbe..ca270a0648 100644 --- a/src/qml/jit/qv4assembler.cpp +++ b/src/qml/jit/qv4assembler.cpp @@ -546,7 +546,7 @@ public: ~QIODevicePrintStream() {} - void vprintf(const char* format, va_list argList) WTF_ATTRIBUTE_PRINTF(2, 0) + void vprintf(const char* format, va_list argList) override WTF_ATTRIBUTE_PRINTF(2, 0) { const int written = qvsnprintf(buf.data(), buf.size(), format, argList); if (written > 0) @@ -554,7 +554,7 @@ public: memset(buf.data(), 0, qMin(written, buf.size())); } - void flush() + void flush() override {} private: diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 9e6d046485..e99335a117 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -761,7 +761,7 @@ class QQmlThreadNotifierProxyObject : public QObject public: QPointer target; - virtual int qt_metacall(QMetaObject::Call, int methodIndex, void **a) { + int qt_metacall(QMetaObject::Call, int methodIndex, void **a) override { if (!target) return -1; diff --git a/src/qml/types/qquickpackage.cpp b/src/qml/types/qquickpackage.cpp index 47d9f2f483..17eff5ac40 100644 --- a/src/qml/types/qquickpackage.cpp +++ b/src/qml/types/qquickpackage.cpp @@ -89,7 +89,7 @@ public: { DataGuard(QObject *obj, QList *l) : list(l) { (QQmlGuard&)*this = obj; } QList *list; - void objectDestroyed(QObject *) { + void objectDestroyed(QObject *) override { // we assume priv will always be destroyed after objectDestroyed calls list->removeOne(*this); } diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index b9d312d41f..c77495a1a7 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -103,8 +103,8 @@ public: virtual QVariant value(int role) const = 0; virtual void setValue(int role, const QVariant &value) = 0; - void setValue(const QString &role, const QVariant &value); - bool resolveIndex(const QQmlAdaptorModel &model, int idx); + void setValue(const QString &role, const QVariant &value) override; + bool resolveIndex(const QQmlAdaptorModel &model, int idx) override; static QV4::ReturnedValue get_property(QV4::CallContext *ctx, uint propertyId); static QV4::ReturnedValue set_property(QV4::CallContext *ctx, uint propertyId); @@ -141,7 +141,7 @@ public: const QList &items, int index, int count, - const QVector &roles) const + const QVector &roles) const override { bool changed = roles.isEmpty() && !watchedRoles.isEmpty(); if (!changed && !watchedRoles.isEmpty() && watchedRoleIds.isEmpty()) { @@ -185,7 +185,7 @@ public: void replaceWatchedRoles( QQmlAdaptorModel &, const QList &oldRoles, - const QList &newRoles) const + const QList &newRoles) const override { VDMModelDelegateDataType *dataType = const_cast(this); @@ -239,12 +239,12 @@ public: // QAbstractDynamicMetaObject - void objectDestroyed(QObject *) + void objectDestroyed(QObject *) override { release(); } - int metaCall(QObject *object, QMetaObject::Call call, int id, void **arguments) + int metaCall(QObject *object, QMetaObject::Call call, int id, void **arguments) override { return static_cast(object)->metaCall(call, id, arguments); } @@ -415,18 +415,18 @@ public: } } - QVariant value(int role) const + QVariant value(int role) const override { return type->model->aim()->index(index, 0, type->model->rootIndex).data(role); } - void setValue(int role, const QVariant &value) + void setValue(int role, const QVariant &value) override { type->model->aim()->setData( type->model->aim()->index(index, 0, type->model->rootIndex), value, role); } - QV4::ReturnedValue get() + QV4::ReturnedValue get() override { if (type->prototype.isUndefined()) { QQmlAdaptorModelEngineData * const data = engineData(v4); @@ -449,12 +449,12 @@ public: { } - int count(const QQmlAdaptorModel &model) const + int count(const QQmlAdaptorModel &model) const override { return model.aim()->rowCount(model.rootIndex); } - void cleanup(QQmlAdaptorModel &model, QQmlDelegateModel *vdm) const + void cleanup(QQmlAdaptorModel &model, QQmlDelegateModel *vdm) const override { QAbstractItemModel * const aim = model.aim(); if (aim && vdm) { @@ -477,7 +477,7 @@ public: const_cast(this)->release(); } - QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const + QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const override { QHash::const_iterator it = roleNames.find(role.toUtf8()); if (it != roleNames.end()) { @@ -489,26 +489,26 @@ public: } } - QVariant parentModelIndex(const QQmlAdaptorModel &model) const + QVariant parentModelIndex(const QQmlAdaptorModel &model) const override { return model ? QVariant::fromValue(model.aim()->parent(model.rootIndex)) : QVariant(); } - QVariant modelIndex(const QQmlAdaptorModel &model, int index) const + QVariant modelIndex(const QQmlAdaptorModel &model, int index) const override { return model ? QVariant::fromValue(model.aim()->index(index, 0, model.rootIndex)) : QVariant(); } - bool canFetchMore(const QQmlAdaptorModel &model) const + bool canFetchMore(const QQmlAdaptorModel &model) const override { return model && model.aim()->canFetchMore(model.rootIndex); } - void fetchMore(QQmlAdaptorModel &model) const + void fetchMore(QQmlAdaptorModel &model) const override { if (model) model.aim()->fetchMore(model.rootIndex); @@ -518,7 +518,7 @@ public: QQmlAdaptorModel &model, QQmlDelegateModelItemMetaType *metaType, QQmlEngine *engine, - int index) const + int index) const override { VDMAbstractItemModelDataType *dataType = const_cast(this); if (!metaObject) @@ -606,7 +606,7 @@ public: return QV4::Encode::undefined(); } - QV4::ReturnedValue get() + QV4::ReturnedValue get() override { QQmlAdaptorModelEngineData *data = engineData(v4); QV4::Scope scope(v4); @@ -617,13 +617,13 @@ public: return o.asReturnedValue(); } - void setValue(const QString &role, const QVariant &value) + void setValue(const QString &role, const QVariant &value) override { if (role == QLatin1String("modelData")) cachedData = value; } - bool resolveIndex(const QQmlAdaptorModel &model, int idx) + bool resolveIndex(const QQmlAdaptorModel &model, int idx) override { if (index == -1) { index = idx; @@ -650,12 +650,12 @@ class VDMListDelegateDataType : public QQmlAdaptorModel::Accessors public: inline VDMListDelegateDataType() {} - int count(const QQmlAdaptorModel &model) const + int count(const QQmlAdaptorModel &model) const override { return model.list.count(); } - QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const + QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const override { return role == QLatin1String("modelData") ? model.list.at(index) @@ -666,7 +666,7 @@ public: QQmlAdaptorModel &model, QQmlDelegateModelItemMetaType *metaType, QQmlEngine *, - int index) const + int index) const override { return new QQmlDMListAccessorData( metaType, @@ -693,7 +693,7 @@ public: QObject *object); QObject *modelData() const { return object; } - QObject *proxiedObject() { return object; } + QObject *proxiedObject() override { return object; } QPointer object; }; @@ -735,12 +735,12 @@ public: free(metaObject); } - int count(const QQmlAdaptorModel &model) const + int count(const QQmlAdaptorModel &model) const override { return model.list.count(); } - QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const + QVariant value(const QQmlAdaptorModel &model, int index, const QString &role) const override { if (QObject *object = model.list.at(index).value()) return object->property(role.toUtf8()); @@ -751,7 +751,7 @@ public: QQmlAdaptorModel &model, QQmlDelegateModelItemMetaType *metaType, QQmlEngine *, - int index) const + int index) const override { VDMObjectDelegateDataType *dataType = const_cast(this); if (!metaObject) @@ -768,7 +768,7 @@ public: metaObject = builder.toMetaObject(); } - void cleanup(QQmlAdaptorModel &, QQmlDelegateModel *) const + void cleanup(QQmlAdaptorModel &, QQmlDelegateModel *) const override { const_cast(this)->release(); } @@ -792,7 +792,7 @@ public: m_type->release(); } - int metaCall(QObject *o, QMetaObject::Call call, int id, void **arguments) + int metaCall(QObject *o, QMetaObject::Call call, int id, void **arguments) override { Q_ASSERT(o == m_data); Q_UNUSED(o); @@ -813,7 +813,7 @@ public: } } - int createProperty(const char *name, const char *) + int createProperty(const char *name, const char *) override { if (!m_data->object) return -1; diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp index be92bb0954..70fc5fa65f 100644 --- a/src/quick/items/qquickpositioners.cpp +++ b/src/quick/items/qquickpositioners.cpp @@ -1148,7 +1148,7 @@ public: : QQuickBasePositionerPrivate() {} - void effectiveLayoutDirectionChange() + void effectiveLayoutDirectionChange() override { Q_Q(QQuickRow); // For RTL layout the positioning changes when the width changes. @@ -1447,7 +1447,7 @@ public: : QQuickBasePositionerPrivate() {} - void effectiveLayoutDirectionChange() + void effectiveLayoutDirectionChange() override { Q_Q(QQuickGrid); // For RTL layout the positioning changes when the width changes. @@ -2040,7 +2040,7 @@ public: : QQuickBasePositionerPrivate(), flow(QQuickFlow::LeftToRight) {} - void effectiveLayoutDirectionChange() + void effectiveLayoutDirectionChange() override { Q_Q(QQuickFlow); // Don't postpone, as it might be the only trigger for visible changes. diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp index f8c1a3d90b..ad6cf39425 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaprenderer.cpp @@ -64,7 +64,7 @@ void QSGSoftwarePixmapRenderer::renderScene(uint) class B : public QSGBindable { public: - void bind() const { } + void bind() const override { } } bindable; QSGRenderer::renderScene(bindable); } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp index cad826fb27..85d04fe136 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp @@ -90,7 +90,7 @@ void QSGSoftwareRenderer::renderScene(uint) class B : public QSGBindable { public: - void bind() const { } + void bind() const override { } } bindable; QSGRenderer::renderScene(bindable); } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp index 8abbefdd48..682f89721e 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp @@ -188,8 +188,8 @@ public: delete rc; } - bool event(QEvent *e); - void run(); + bool event(QEvent *e) override; + void run() override; void syncAndRender(); void sync(bool inExpose); diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index e5d464930c..9207fdbc55 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -189,7 +189,7 @@ void QSGRenderer::renderScene(uint fboId) class B : public QSGBindable { public: - void bind() const { QOpenGLFramebufferObject::bindDefault(); } + void bind() const override { QOpenGLFramebufferObject::bindDefault(); } } bindable; renderScene(bindable); } diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index 405f1d86a4..d31a7025e5 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -68,13 +68,13 @@ QT_BEGIN_NAMESPACE namespace QSGMultisampleAntialiasing { class ImageNode : public QSGDefaultInternalImageNode { public: - void setAntialiasing(bool) { } + void setAntialiasing(bool) override { } }; class RectangleNode : public QSGDefaultInternalRectangleNode { public: - void setAntialiasing(bool) { } + void setAntialiasing(bool) override { } }; } diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index b001899915..edb6e92a0d 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -91,11 +91,11 @@ class QSGTextMaskShader : public QSGMaterialShader public: QSGTextMaskShader(QFontEngine::GlyphFormat glyphFormat); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual char const *const *attributeNames() const; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; protected: - virtual void initialize(); + void initialize() override; int m_matrix_id; int m_color_id; @@ -181,7 +181,7 @@ public: setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/8bittextmask.frag")); } - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; }; void QSG8BitTextMaskShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) @@ -206,10 +206,10 @@ public: setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/24bittextmask.frag")); } - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual void initialize(); - void activate(); - void deactivate(); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + void initialize() override; + void activate() override; + void deactivate() override; bool useSRGB() const; uint m_useSRGB : 1; @@ -326,10 +326,10 @@ public: setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/styledtext.frag")); } - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; private: - virtual void initialize(); + void initialize() override; int m_shift_id; int m_styleColor_id; diff --git a/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp b/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp index 1d54628acd..a5a6da06a7 100644 --- a/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp @@ -50,11 +50,11 @@ class SmoothTextureMaterialShader : public QSGTextureMaterialShader public: SmoothTextureMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual char const *const *attributeNames() const; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; protected: - virtual void initialize(); + void initialize() override; int m_pixelSizeLoc; }; diff --git a/src/quick/scenegraph/qsgdefaultinternalrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultinternalrectanglenode.cpp index 94414444ba..e52dcaad52 100644 --- a/src/quick/scenegraph/qsgdefaultinternalrectanglenode.cpp +++ b/src/quick/scenegraph/qsgdefaultinternalrectanglenode.cpp @@ -55,11 +55,11 @@ class SmoothColorMaterialShader : public QSGMaterialShader public: SmoothColorMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual char const *const *attributeNames() const; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; private: - virtual void initialize(); + void initialize() override; int m_matrixLoc; int m_opacityLoc; diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp index ca91e5d85f..fc66f2f2cc 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp @@ -52,11 +52,11 @@ class QSGDistanceFieldTextMaterialShader : public QSGMaterialShader public: QSGDistanceFieldTextMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual char const *const *attributeNames() const; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; protected: - virtual void initialize(); + void initialize() override; void updateAlphaRange(ThresholdFunc thresholdFunc, AntialiasingSpreadFunc spreadFunc); void updateColor(const QVector4D &c); @@ -261,10 +261,10 @@ class DistanceFieldStyledTextMaterialShader : public QSGDistanceFieldTextMateria public: DistanceFieldStyledTextMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; protected: - virtual void initialize(); + void initialize() override; int m_styleColor_id; }; @@ -329,10 +329,10 @@ class DistanceFieldOutlineTextMaterialShader : public DistanceFieldStyledTextMat public: DistanceFieldOutlineTextMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; protected: - virtual void initialize(); + void initialize() override; void updateOutlineAlphaRange(ThresholdFunc thresholdFunc, AntialiasingSpreadFunc spreadFunc, int dfRadius); @@ -413,10 +413,10 @@ class DistanceFieldShiftedStyleTextMaterialShader : public DistanceFieldStyledTe public: DistanceFieldShiftedStyleTextMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; protected: - virtual void initialize(); + void initialize() override; void updateShift(qreal fontScale, const QPointF& shift); @@ -492,10 +492,10 @@ class QSGHiQSubPixelDistanceFieldTextMaterialShader : public QSGDistanceFieldTex public: QSGHiQSubPixelDistanceFieldTextMaterialShader(); - virtual void initialize(); - virtual void activate(); - virtual void deactivate(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); + void initialize() override; + void activate() override; + void deactivate() override; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; private: int m_fontScale_id; diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 48288bfc62..bb581c5e36 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -139,25 +139,25 @@ public: QSGGuiThreadRenderLoop(); ~QSGGuiThreadRenderLoop(); - void show(QQuickWindow *window); - void hide(QQuickWindow *window); + void show(QQuickWindow *window) override; + void hide(QQuickWindow *window) override; - void windowDestroyed(QQuickWindow *window); + void windowDestroyed(QQuickWindow *window) override; void renderWindow(QQuickWindow *window); - void exposureChanged(QQuickWindow *window); - QImage grab(QQuickWindow *window); + void exposureChanged(QQuickWindow *window) override; + QImage grab(QQuickWindow *window) override; - void maybeUpdate(QQuickWindow *window); - void update(QQuickWindow *window) { maybeUpdate(window); } // identical for this implementation. - void handleUpdateRequest(QQuickWindow *); + void maybeUpdate(QQuickWindow *window) override; + void update(QQuickWindow *window) override { maybeUpdate(window); } // identical for this implementation. + void handleUpdateRequest(QQuickWindow *) override; - void releaseResources(QQuickWindow *) { } + void releaseResources(QQuickWindow *) override { } - QAnimationDriver *animationDriver() const { return 0; } + QAnimationDriver *animationDriver() const override { return 0; } - QSGContext *sceneGraphContext() const; - QSGRenderContext *createRenderContext(QSGContext *) const { return rc; } + QSGContext *sceneGraphContext() const override; + QSGRenderContext *createRenderContext(QSGContext *) const override { return rc; } struct WindowData { bool updatePending : 1; diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 5fa74027c1..17a2c62a4e 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -295,8 +295,8 @@ public: void invalidateOpenGL(QQuickWindow *window, bool inDestructor, QOffscreenSurface *backupSurface); void initializeOpenGL(); - bool event(QEvent *); - void run(); + bool event(QEvent *) override; + void run() override; void syncAndRender(); void sync(bool inExpose); diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp index 8ab7669891..a0c71b5340 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp @@ -50,13 +50,13 @@ class FlatColorMaterialShader : public QSGMaterialShader public: FlatColorMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual char const *const *attributeNames() const; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; static QSGMaterialType type; private: - virtual void initialize(); + void initialize() override; #if QT_CONFIG(opengl) int m_matrix_id; int m_color_id; diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp index 8c305d7fd4..42c589b14a 100644 --- a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp @@ -48,13 +48,13 @@ class QSGVertexColorMaterialShader : public QSGMaterialShader public: QSGVertexColorMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual char const *const *attributeNames() const; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; static QSGMaterialType type; private: - virtual void initialize(); + void initialize() override; #if QT_CONFIG(opengl) int m_matrix_id; int m_opacity_id; diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 5a723e4432..20bb23338d 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE class QQuickColorProvider : public QQmlColorProvider { public: - QVariant colorFromString(const QString &s, bool *ok) + QVariant colorFromString(const QString &s, bool *ok) override { QColor c(s); if (c.isValid()) { @@ -73,7 +73,7 @@ public: return QVariant(); } - unsigned rgbaFromString(const QString &s, bool *ok) + unsigned rgbaFromString(const QString &s, bool *ok) override { QColor c(s); if (c.isValid()) { @@ -95,36 +95,36 @@ public: return QString(); } - QVariant fromRgbF(double r, double g, double b, double a) + QVariant fromRgbF(double r, double g, double b, double a) override { return QVariant(QColor::fromRgbF(r, g, b, a)); } - QVariant fromHslF(double h, double s, double l, double a) + QVariant fromHslF(double h, double s, double l, double a) override { return QVariant(QColor::fromHslF(h, s, l, a)); } - QVariant fromHsvF(double h, double s, double v, double a) + QVariant fromHsvF(double h, double s, double v, double a) override { return QVariant(QColor::fromHsvF(h, s, v, a)); } - QVariant lighter(const QVariant &var, qreal factor) + QVariant lighter(const QVariant &var, qreal factor) override { QColor color = var.value(); color = color.lighter(int(qRound(factor*100.))); return QVariant::fromValue(color); } - QVariant darker(const QVariant &var, qreal factor) + QVariant darker(const QVariant &var, qreal factor) override { QColor color = var.value(); color = color.darker(int(qRound(factor*100.))); return QVariant::fromValue(color); } - QVariant tint(const QVariant &baseVar, const QVariant &tintVar) + QVariant tint(const QVariant &baseVar, const QVariant &tintVar) override { QColor tintColor = tintVar.value(); @@ -778,13 +778,13 @@ public: class QQuickGuiProvider : public QQmlGuiProvider { public: - QQuickApplication *application(QObject *parent) + QQuickApplication *application(QObject *parent) override { return new QQuickApplication(parent); } #if QT_CONFIG(im) - QInputMethod *inputMethod() + QInputMethod *inputMethod() override { QInputMethod *im = qGuiApp->inputMethod(); QQmlEngine::setObjectOwnership(im, QQmlEngine::CppOwnership); @@ -792,20 +792,20 @@ public: } #endif - QStyleHints *styleHints() + QStyleHints *styleHints() override { QStyleHints *sh = qGuiApp->styleHints(); QQmlEngine::setObjectOwnership(sh, QQmlEngine::CppOwnership); return sh; } - QStringList fontFamilies() + QStringList fontFamilies() override { QFontDatabase database; return database.families(); } - bool openUrlExternally(QUrl &url) + bool openUrlExternally(QUrl &url) override { #ifndef QT_NO_DESKTOPSERVICES return QDesktopServices::openUrl(url); diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index be27cba989..395b89c784 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -161,7 +161,7 @@ Q_SIGNALS: void downloadProgress(qint64, qint64); protected: - bool event(QEvent *event); + bool event(QEvent *event) override; private: Q_DISABLE_COPY(QQuickPixmapReply) @@ -199,7 +199,7 @@ public: static QQuickPixmapReader *existingInstance(QQmlEngine *engine); protected: - void run(); + void run() override; private: friend class QQuickPixmapReaderThreadObject; -- cgit v1.2.3