aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 17:34:27 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-27 08:27:38 +0000
commite17c89f4ce74e5699ed50dc2187a39d8990316c4 (patch)
treeb1f9b85d5bd1233d8931813dc4e06f7342be2249 /examples/quick/scenegraph
parente41d067227eb6225b05df88ab724708588fa5304 (diff)
use the override keyword consistently and correctly (clang-tidy)
Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples/quick/scenegraph')
-rw-r--r--examples/quick/scenegraph/graph/linenode.cpp6
-rw-r--r--examples/quick/scenegraph/graph/noisynode.cpp6
-rw-r--r--examples/quick/scenegraph/simplematerial/simplematerial.cpp12
-rw-r--r--examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp4
-rw-r--r--examples/quick/scenegraph/textureinthread/threadrenderer.cpp2
-rw-r--r--examples/quick/scenegraph/threadedanimation/spinner.cpp2
-rw-r--r--examples/quick/scenegraph/twotextureproviders/xorblender.cpp12
7 files changed, 22 insertions, 22 deletions
diff --git a/examples/quick/scenegraph/graph/linenode.cpp b/examples/quick/scenegraph/graph/linenode.cpp
index b9ce1afc38..cb7f1c8e7f 100644
--- a/examples/quick/scenegraph/graph/linenode.cpp
+++ b/examples/quick/scenegraph/graph/linenode.cpp
@@ -71,15 +71,15 @@ public:
setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/line.fsh");
}
- QList<QByteArray> attributes() const { return QList<QByteArray>() << "pos" << "t"; }
+ QList<QByteArray> attributes() const override { return QList<QByteArray>() << "pos" << "t"; }
- void updateState(const LineMaterial *m, const LineMaterial *) {
+ void updateState(const LineMaterial *m, const LineMaterial *) override {
program()->setUniformValue(id_color, m->color);
program()->setUniformValue(id_spread, m->spread);
program()->setUniformValue(id_size, m->size);
}
- void resolveUniforms() {
+ void resolveUniforms() override {
id_spread = program()->uniformLocation("spread");
id_size = program()->uniformLocation("size");
id_color = program()->uniformLocation("color");
diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp
index d1eaa1ec26..de5a616da2 100644
--- a/examples/quick/scenegraph/graph/noisynode.cpp
+++ b/examples/quick/scenegraph/graph/noisynode.cpp
@@ -77,9 +77,9 @@ public:
setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/noisy.fsh");
}
- QList<QByteArray> attributes() const { return QList<QByteArray>() << "aVertex" << "aTexCoord"; }
+ QList<QByteArray> attributes() const override { return QList<QByteArray>() << "aVertex" << "aTexCoord"; }
- void updateState(const NoisyMaterial *m, const NoisyMaterial *) {
+ void updateState(const NoisyMaterial *m, const NoisyMaterial *) override {
// Set the color
program()->setUniformValue(id_color, m->color);
@@ -93,7 +93,7 @@ public:
program()->setUniformValue(id_textureSize, QSizeF(1.0 / s.width(), 1.0 / s.height()));
}
- void resolveUniforms() {
+ void resolveUniforms() override {
id_texture = program()->uniformLocation("texture");
id_textureSize = program()->uniformLocation("textureSize");
id_color = program()->uniformLocation("color");
diff --git a/examples/quick/scenegraph/simplematerial/simplematerial.cpp b/examples/quick/scenegraph/simplematerial/simplematerial.cpp
index 96c08aff04..6773b6fb5a 100644
--- a/examples/quick/scenegraph/simplematerial/simplematerial.cpp
+++ b/examples/quick/scenegraph/simplematerial/simplematerial.cpp
@@ -87,7 +87,7 @@ class Shader : public QSGSimpleMaterialShader<State>
//! [2] //! [3]
public:
- const char *vertexShader() const {
+ const char *vertexShader() const override {
return
"attribute highp vec4 aVertex; \n"
"attribute highp vec2 aTexCoord; \n"
@@ -99,7 +99,7 @@ public:
"}";
}
- const char *fragmentShader() const {
+ const char *fragmentShader() const override {
return
"uniform lowp float qt_Opacity; \n"
"uniform lowp vec4 color; \n"
@@ -110,17 +110,17 @@ public:
"}";
}
//! [3] //! [4]
- QList<QByteArray> attributes() const
+ QList<QByteArray> attributes() const override
{
return QList<QByteArray>() << "aVertex" << "aTexCoord";
}
//! [4] //! [5]
- void updateState(const State *state, const State *)
+ void updateState(const State *state, const State *) override
{
program()->setUniformValue(id_color, state->color);
}
//! [5] //! [6]
- void resolveUniforms()
+ void resolveUniforms() override
{
id_color = program()->uniformLocation("color");
}
@@ -184,7 +184,7 @@ private:
//! [8] //! [9]
public:
- QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
+ QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *) override
{
ColorNode *n = static_cast<ColorNode *>(node);
if (!node)
diff --git a/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp b/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp
index 0b9617b55f..8ba5bddb2a 100644
--- a/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp
+++ b/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp
@@ -64,12 +64,12 @@ public:
logo.initialize();
}
- void render() {
+ void render() override {
logo.render();
update();
}
- QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) {
+ QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override {
QOpenGLFramebufferObjectFormat format;
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setSamples(4);
diff --git a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp
index 27cb0eb5ea..c364d0b7dd 100644
--- a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp
+++ b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp
@@ -165,7 +165,7 @@ public:
setFiltering(QSGTexture::Linear);
}
- ~TextureNode()
+ ~TextureNode() override
{
delete m_texture;
}
diff --git a/examples/quick/scenegraph/threadedanimation/spinner.cpp b/examples/quick/scenegraph/threadedanimation/spinner.cpp
index 83c4494720..c19354b3f5 100644
--- a/examples/quick/scenegraph/threadedanimation/spinner.cpp
+++ b/examples/quick/scenegraph/threadedanimation/spinner.cpp
@@ -78,7 +78,7 @@ public:
appendChildNode(textureNode);
}
- ~SpinnerNode() {
+ ~SpinnerNode() override {
delete m_texture;
}
diff --git a/examples/quick/scenegraph/twotextureproviders/xorblender.cpp b/examples/quick/scenegraph/twotextureproviders/xorblender.cpp
index 3c02c4695e..8d7597addf 100644
--- a/examples/quick/scenegraph/twotextureproviders/xorblender.cpp
+++ b/examples/quick/scenegraph/twotextureproviders/xorblender.cpp
@@ -77,7 +77,7 @@ class XorBlendShader : public QSGSimpleMaterialShader<XorBlendState>
QSG_DECLARE_SIMPLE_SHADER(XorBlendShader, XorBlendState)
public:
- const char *vertexShader() const {
+ const char *vertexShader() const override {
return
"attribute highp vec4 aVertex; \n"
"attribute highp vec2 aTexCoord; \n"
@@ -89,7 +89,7 @@ public:
"}";
}
- const char *fragmentShader() const {
+ const char *fragmentShader() const override {
return
"uniform lowp float qt_Opacity; \n"
"uniform lowp sampler2D uSource1; \n"
@@ -102,11 +102,11 @@ public:
"}";
}
- QList<QByteArray> attributes() const {
+ QList<QByteArray> attributes() const override {
return QList<QByteArray>() << "aVertex" << "aTexCoord";
}
- void updateState(const XorBlendState *state, const XorBlendState *) {
+ void updateState(const XorBlendState *state, const XorBlendState *) override {
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
// We bind the textures in inverse order so that we leave the updateState
// function with GL_TEXTURE0 as the active texture unit. This is maintain
@@ -118,7 +118,7 @@ public:
state->texture1->bind();
}
- void resolveUniforms() {
+ void resolveUniforms() override {
// The texture units never change, only the texturess we bind to them so
// we set these once and for all here.
program()->setUniformValue("uSource1", 0); // GL_TEXTURE0
@@ -165,7 +165,7 @@ public:
connect(m_provider2.data(), &QSGTextureProvider::textureChanged, this, &XorNode::textureChange, Qt::DirectConnection);
}
- void preprocess() {
+ void preprocess() override {
XorBlendState *state = m_material->state();
// Update the textures from the providers, calling into QSGDynamicTexture if required
if (m_provider1) {