From ac719f2d942515efdb222a2bc98c93dd261c37bc Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 16 Sep 2016 10:16:31 +0300 Subject: scenegraph: add missing 'override' ... and drop redundant 'virtual' Change-Id: Id9354138d5b17383a33d0c2a0a26f0e85122cfc7 Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/util/qsgatlastexture_p.h | 16 ++++++------ .../scenegraph/util/qsgdefaultpainternode_p.h | 30 +++++++++++----------- .../scenegraph/util/qsgdepthstencilbuffer_p.h | 2 +- src/quick/scenegraph/util/qsgflatcolormaterial.h | 6 ++--- src/quick/scenegraph/util/qsgsimplematerial.h | 4 +-- src/quick/scenegraph/util/qsgtexture_p.h | 10 ++++---- src/quick/scenegraph/util/qsgtexturematerial.h | 10 ++++---- src/quick/scenegraph/util/qsgtexturematerial_p.h | 10 ++++---- src/quick/scenegraph/util/qsgvertexcolormaterial.h | 6 ++--- 9 files changed, 47 insertions(+), 47 deletions(-) (limited to 'src/quick/scenegraph/util') diff --git a/src/quick/scenegraph/util/qsgatlastexture_p.h b/src/quick/scenegraph/util/qsgatlastexture_p.h index cd24645fcf..3dee539547 100644 --- a/src/quick/scenegraph/util/qsgatlastexture_p.h +++ b/src/quick/scenegraph/util/qsgatlastexture_p.h @@ -131,26 +131,26 @@ public: Texture(Atlas *atlas, const QRect &textureRect, const QImage &image); ~Texture(); - int textureId() const { return m_atlas->textureId(); } - QSize textureSize() const { return atlasSubRectWithoutPadding().size(); } + int textureId() const override { return m_atlas->textureId(); } + QSize textureSize() const override { return atlasSubRectWithoutPadding().size(); } void setHasAlphaChannel(bool alpha) { m_has_alpha = alpha; } - bool hasAlphaChannel() const { return m_has_alpha; } - bool hasMipmaps() const { return false; } - bool isAtlasTexture() const { return true; } + bool hasAlphaChannel() const override { return m_has_alpha; } + bool hasMipmaps() const override { return false; } + bool isAtlasTexture() const override { return true; } - QRectF normalizedTextureSubRect() const { return m_texture_coords_rect; } + QRectF normalizedTextureSubRect() const override { return m_texture_coords_rect; } QRect atlasSubRect() const { return m_allocated_rect; } QRect atlasSubRectWithoutPadding() const { return m_allocated_rect.adjusted(1, 1, -1, -1); } bool isTexture() const { return true; } - QSGTexture *removedFromAtlas() const; + QSGTexture *removedFromAtlas() const override; void releaseImage() { m_image = QImage(); } const QImage &image() const { return m_image; } - void bind(); + void bind() override; private: QRect m_allocated_rect; diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h index 069ef155b1..a433b3292a 100644 --- a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h +++ b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h @@ -72,7 +72,7 @@ public: void setDirtyRect(const QRect &rect) { m_dirty_rect = rect; } - void bind(); + void bind() override; private: QRect m_dirty_rect; @@ -84,43 +84,43 @@ public: QSGDefaultPainterNode(QQuickPaintedItem *item); virtual ~QSGDefaultPainterNode(); - void setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target); + void setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) override; - void setSize(const QSize &size); + void setSize(const QSize &size) override; QSize size() const { return m_size; } - void setDirty(const QRect &dirtyRect = QRect()); + void setDirty(const QRect &dirtyRect = QRect()) override; - void setOpaquePainting(bool opaque); + void setOpaquePainting(bool opaque) override; bool opaquePainting() const { return m_opaquePainting; } - void setLinearFiltering(bool linearFiltering); + void setLinearFiltering(bool linearFiltering) override; bool linearFiltering() const { return m_linear_filtering; } - void setMipmapping(bool mipmapping); + void setMipmapping(bool mipmapping) override; bool mipmapping() const { return m_mipmapping; } - void setSmoothPainting(bool s); + void setSmoothPainting(bool s) override; bool smoothPainting() const { return m_smoothPainting; } - void setFillColor(const QColor &c); + void setFillColor(const QColor &c) override; QColor fillColor() const { return m_fillColor; } - void setContentsScale(qreal s); + void setContentsScale(qreal s) override; qreal contentsScale() const { return m_contentsScale; } - void setFastFBOResizing(bool dynamic); + void setFastFBOResizing(bool dynamic) override; bool fastFBOResizing() const { return m_fastFBOResizing; } - void setTextureSize(const QSize &textureSize); + void setTextureSize(const QSize &textureSize) override; QSize textureSize() const { return m_textureSize; } - QImage toImage() const; - void update(); + QImage toImage() const override; + void update() override; void paint(); - QSGTexture *texture() const { return m_texture; } + QSGTexture *texture() const override { return m_texture; } private: void updateTexture(); diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h b/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h index c2d0590532..f7c6923021 100644 --- a/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h +++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h @@ -119,7 +119,7 @@ public: virtual ~QSGDefaultDepthStencilBuffer(); protected: - virtual void free(); + void free() override; }; diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.h b/src/quick/scenegraph/util/qsgflatcolormaterial.h index 7f292a2a9b..4829ac3279 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.h +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.h @@ -49,13 +49,13 @@ class Q_QUICK_EXPORT QSGFlatColorMaterial : public QSGMaterial { public: QSGFlatColorMaterial(); - virtual QSGMaterialType *type() const; - virtual QSGMaterialShader *createShader() const; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; void setColor(const QColor &color); const QColor &color() const { return m_color; } - int compare(const QSGMaterial *other) const; + int compare(const QSGMaterial *other) const override; private: QColor m_color; diff --git a/src/quick/scenegraph/util/qsgsimplematerial.h b/src/quick/scenegraph/util/qsgsimplematerial.h index d07a68e850..01f98767fd 100644 --- a/src/quick/scenegraph/util/qsgsimplematerial.h +++ b/src/quick/scenegraph/util/qsgsimplematerial.h @@ -149,8 +149,8 @@ public: { } - QSGMaterialShader *createShader() const { return m_func(); } - QSGMaterialType *type() const { return &m_type; } + QSGMaterialShader *createShader() const override { return m_func(); } + QSGMaterialType *type() const override { return &m_type; } State *state() { return &m_state; } const State *state() const { return &m_state; } diff --git a/src/quick/scenegraph/util/qsgtexture_p.h b/src/quick/scenegraph/util/qsgtexture_p.h index a0d7eb41e3..e09cbdbef1 100644 --- a/src/quick/scenegraph/util/qsgtexture_p.h +++ b/src/quick/scenegraph/util/qsgtexture_p.h @@ -87,19 +87,19 @@ public: bool ownsTexture() const { return m_owns_texture; } void setTextureId(int id); - int textureId() const; + int textureId() const override; void setTextureSize(const QSize &size) { m_texture_size = size; } - QSize textureSize() const { return m_texture_size; } + QSize textureSize() const override { return m_texture_size; } void setHasAlphaChannel(bool alpha) { m_has_alpha = alpha; } - bool hasAlphaChannel() const { return m_has_alpha; } + bool hasAlphaChannel() const override { return m_has_alpha; } - bool hasMipmaps() const { return mipmapFiltering() != QSGTexture::None; } + bool hasMipmaps() const override { return mipmapFiltering() != QSGTexture::None; } void setImage(const QImage &image); const QImage &image() { return m_image; } - virtual void bind(); + void bind() override; static QSGPlainTexture *fromImage(const QImage &image) { QSGPlainTexture *t = new QSGPlainTexture(); diff --git a/src/quick/scenegraph/util/qsgtexturematerial.h b/src/quick/scenegraph/util/qsgtexturematerial.h index 02b59108b3..dc87131773 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial.h +++ b/src/quick/scenegraph/util/qsgtexturematerial.h @@ -50,9 +50,9 @@ class Q_QUICK_EXPORT QSGOpaqueTextureMaterial : public QSGMaterial public: QSGOpaqueTextureMaterial(); - virtual QSGMaterialType *type() const; - virtual QSGMaterialShader *createShader() const; - virtual int compare(const QSGMaterial *other) const; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; + int compare(const QSGMaterial *other) const override; void setTexture(QSGTexture *texture); QSGTexture *texture() const { return m_texture; } @@ -84,8 +84,8 @@ protected: class Q_QUICK_EXPORT QSGTextureMaterial : public QSGOpaqueTextureMaterial { public: - virtual QSGMaterialType *type() const; - virtual QSGMaterialShader *createShader() const; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; }; QT_END_NAMESPACE diff --git a/src/quick/scenegraph/util/qsgtexturematerial_p.h b/src/quick/scenegraph/util/qsgtexturematerial_p.h index 75e5877a72..093d820801 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial_p.h +++ b/src/quick/scenegraph/util/qsgtexturematerial_p.h @@ -61,13 +61,13 @@ class Q_QUICK_PRIVATE_EXPORT QSGOpaqueTextureMaterialShader : public QSGMaterial public: QSGOpaqueTextureMaterialShader(); - 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; protected: - virtual void initialize(); + void initialize() override; int m_matrix_id; }; @@ -77,8 +77,8 @@ class QSGTextureMaterialShader : public QSGOpaqueTextureMaterialShader public: QSGTextureMaterialShader(); - virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect); - virtual void initialize(); + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + void initialize() override; static QSGMaterialType type; diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.h b/src/quick/scenegraph/util/qsgvertexcolormaterial.h index 68f32d8af0..65cb642d92 100644 --- a/src/quick/scenegraph/util/qsgvertexcolormaterial.h +++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.h @@ -49,11 +49,11 @@ class Q_QUICK_EXPORT QSGVertexColorMaterial : public QSGMaterial public: QSGVertexColorMaterial(); - int compare(const QSGMaterial *other) const; + int compare(const QSGMaterial *other) const override; protected: - virtual QSGMaterialType *type() const; - virtual QSGMaterialShader *createShader() const; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; }; QT_END_NAMESPACE -- cgit v1.2.3