diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2014-07-14 09:13:02 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2014-07-15 08:44:44 +0200 |
commit | 3b0c2b7c1b3ccdfe6867884a7e210bfc63e10f84 (patch) | |
tree | 4c75a4fa9f023c4bfc6746a4412922a8efe3b017 /examples/widgets/graphicsview/boxes/glbuffers.h | |
parent | 6d87e3ed40173eac8c275d5926266359d53c74c7 (diff) |
Examples: Add Q_DECL_OVERRIDE to overridden functions
Q_DECL_OVERRIDE (which expands to 'override' for supported compiler)
helps to declare the intent (that it is an overridden function) and
force compilation error when there is no such virtual function in the
base class.
The examples should show the best practice of having it, as it may save
the programmer quite some time in case of change of API or typo in the
function name or arguments.
This change was done automatically with
clang-modernize -add-override -override-macros
And fixed MSVC compilation by removing inline for TorrentViewDelegate::paint
Change-Id: Ice66ae93fae571266f908703d5b8892b2c1ebb1a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'examples/widgets/graphicsview/boxes/glbuffers.h')
-rw-r--r-- | examples/widgets/graphicsview/boxes/glbuffers.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h index 304b3da87a..6c6c80eed2 100644 --- a/examples/widgets/graphicsview/boxes/glbuffers.h +++ b/examples/widgets/graphicsview/boxes/glbuffers.h @@ -101,8 +101,8 @@ public: GLTexture2D(int width, int height); explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0); void load(int width, int height, QRgb *data); - virtual void bind(); - virtual void unbind(); + virtual void bind() Q_DECL_OVERRIDE; + virtual void unbind() Q_DECL_OVERRIDE; }; class GLTexture3D : public GLTexture @@ -112,8 +112,8 @@ public: // TODO: Implement function below //GLTexture3D(const QString& fileName, int width = 0, int height = 0); void load(int width, int height, int depth, QRgb *data); - virtual void bind(); - virtual void unbind(); + virtual void bind() Q_DECL_OVERRIDE; + virtual void unbind() Q_DECL_OVERRIDE; }; class GLTextureCube : public GLTexture @@ -122,8 +122,8 @@ public: GLTextureCube(int size); explicit GLTextureCube(const QStringList& fileNames, int size = 0); void load(int size, int face, QRgb *data); - virtual void bind(); - virtual void unbind(); + virtual void bind() Q_DECL_OVERRIDE; + virtual void unbind() Q_DECL_OVERRIDE; }; // TODO: Define and implement class below @@ -137,7 +137,7 @@ public: void begin(int face); // end rendering void end(); - virtual bool failed() const {return m_failed || m_fbo.failed();} + virtual bool failed() const Q_DECL_OVERRIDE {return m_failed || m_fbo.failed();} static void getViewMatrix(QMatrix4x4& mat, int face); static void getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ); |