diff options
author | Kevin Funk <kevin.funk@kdab.com> | 2017-09-18 10:36:49 +0200 |
---|---|---|
committer | Kevin Funk <kevin.funk@kdab.com> | 2017-09-19 11:53:42 +0000 |
commit | 47c92fbb0b588b443cead18a5aad5a2b5ad9e4d7 (patch) | |
tree | 330914ff8225867e19b9ed5e049813d9f1e5ec08 /src/opengl | |
parent | 93dd85141b35460a83dac86083581ba1c1975927 (diff) |
Replace Q_DECL_OVERRIDE with override where possible
Remaining uses of Q_DECL_OVERRIDE are in:
src/corelib/global/qcompilerdetection.h
src/corelib/global/qglobal.cpp
doc/global/qt-cpp-defines.qdocconf
(definition and documentation of Q_DECL_OVERRIDE)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 4 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 56 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 16 | ||||
-rw-r--r-- | src/opengl/qgl.h | 8 | ||||
-rw-r--r-- | src/opengl/qgl_p.h | 8 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject.h | 6 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject_p.h | 10 | ||||
-rw-r--r-- | src/opengl/qglfunctions.cpp | 4 | ||||
-rw-r--r-- | src/opengl/qglpaintdevice_p.h | 14 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer.h | 6 | ||||
-rw-r--r-- | src/opengl/qgraphicsshadereffect.cpp | 2 | ||||
-rw-r--r-- | src/opengl/qgraphicsshadereffect_p.h | 2 |
12 files changed, 68 insertions, 68 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index ec673e8726..47e8531959 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -68,13 +68,13 @@ public: delete m_shaders; } - void invalidateResource() Q_DECL_OVERRIDE + void invalidateResource() override { delete m_shaders; m_shaders = 0; } - void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE + void freeResource(QOpenGLContext *) override { } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 0f96732278..d1ed621790 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -108,37 +108,37 @@ public: QGL2PaintEngineEx(); ~QGL2PaintEngineEx(); - bool begin(QPaintDevice *device) Q_DECL_OVERRIDE; + bool begin(QPaintDevice *device) override; void ensureActive(); - bool end() Q_DECL_OVERRIDE; - - virtual void clipEnabledChanged() Q_DECL_OVERRIDE; - virtual void penChanged() Q_DECL_OVERRIDE; - virtual void brushChanged() Q_DECL_OVERRIDE; - virtual void brushOriginChanged() Q_DECL_OVERRIDE; - virtual void opacityChanged() Q_DECL_OVERRIDE; - virtual void compositionModeChanged() Q_DECL_OVERRIDE; - virtual void renderHintsChanged() Q_DECL_OVERRIDE; - virtual void transformChanged() Q_DECL_OVERRIDE; - - virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE; + bool end() override; + + virtual void clipEnabledChanged() override; + virtual void penChanged() override; + virtual void brushChanged() override; + virtual void brushOriginChanged() override; + virtual void opacityChanged() override; + virtual void compositionModeChanged() override; + virtual void renderHintsChanged() override; + virtual void transformChanged() override; + + virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, - QPainter::PixmapFragmentHints hints) Q_DECL_OVERRIDE; + QPainter::PixmapFragmentHints hints) override; virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, - Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE; - virtual void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE; - virtual void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE; - virtual void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE; - virtual void clip(const QVectorPath &path, Qt::ClipOperation op) Q_DECL_OVERRIDE; + Qt::ImageConversionFlags flags = Qt::AutoColor) override; + virtual void drawTextItem(const QPointF &p, const QTextItem &textItem) override; + virtual void fill(const QVectorPath &path, const QBrush &brush) override; + virtual void stroke(const QVectorPath &path, const QPen &pen) override; + virtual void clip(const QVectorPath &path, Qt::ClipOperation op) override; - virtual void drawStaticTextItem(QStaticTextItem *textItem) Q_DECL_OVERRIDE; + virtual void drawStaticTextItem(QStaticTextItem *textItem) override; bool drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr); - Type type() const Q_DECL_OVERRIDE { return OpenGL2; } + Type type() const override { return OpenGL2; } - virtual void setState(QPainterState *s) Q_DECL_OVERRIDE; - virtual QPainterState *createState(QPainterState *orig) const Q_DECL_OVERRIDE; + virtual void setState(QPainterState *s) override; + virtual QPainterState *createState(QPainterState *orig) const override; inline QGL2PaintEngineState *state() { return static_cast<QGL2PaintEngineState *>(QPaintEngineEx::state()); } @@ -146,16 +146,16 @@ public: return static_cast<const QGL2PaintEngineState *>(QPaintEngineEx::state()); } - void beginNativePainting() Q_DECL_OVERRIDE; - void endNativePainting() Q_DECL_OVERRIDE; + void beginNativePainting() override; + void endNativePainting() override; void invalidateState(); void setRenderTextActive(bool); bool isNativePaintingActive() const; - bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const Q_DECL_OVERRIDE { return false; } - bool shouldDrawCachedGlyphs(QFontEngine *, const QTransform &) const Q_DECL_OVERRIDE; + bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const override { return false; } + bool shouldDrawCachedGlyphs(QFontEngine *, const QTransform &) const override; void setTranslateZ(GLfloat z); @@ -244,7 +244,7 @@ public: void updateClipScissorTest(); void setScissor(const QRect &rect); void regenerateClip(); - void systemStateChanged() Q_DECL_OVERRIDE; + void systemStateChanged() override; static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; } diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index 95401d10c1..e76216ef5d 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -79,7 +79,7 @@ struct QGLGlyphTexture : public QOpenGLSharedResource #endif } - void freeResource(QOpenGLContext *context) Q_DECL_OVERRIDE + void freeResource(QOpenGLContext *context) override { const QGLContext *ctx = QGLContext::fromOpenGLContext(context); #ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG @@ -93,7 +93,7 @@ struct QGLGlyphTexture : public QOpenGLSharedResource ctx->contextHandle()->functions()->glDeleteTextures(1, &m_texture); } - void invalidateResource() Q_DECL_OVERRIDE + void invalidateResource() override { m_texture = 0; m_fbo = 0; @@ -113,12 +113,12 @@ public: QGLTextureGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix); ~QGLTextureGlyphCache(); - virtual void createTextureData(int width, int height) Q_DECL_OVERRIDE; - virtual void resizeTextureData(int width, int height) Q_DECL_OVERRIDE; - virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE; - virtual int glyphPadding() const Q_DECL_OVERRIDE; - virtual int maxTextureWidth() const Q_DECL_OVERRIDE; - virtual int maxTextureHeight() const Q_DECL_OVERRIDE; + virtual void createTextureData(int width, int height) override; + virtual void resizeTextureData(int width, int height) override; + virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) override; + virtual int glyphPadding() const override; + virtual int maxTextureWidth() const override; + virtual int maxTextureHeight() const override; inline GLuint texture() const { QGLTextureGlyphCache *that = const_cast<QGLTextureGlyphCache *>(this); diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index ab418c191a..8bafdb1031 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -413,7 +413,7 @@ public: const QFont & fnt = QFont()); void renderText(double x, double y, double z, const QString & str, const QFont & fnt = QFont()); - QPaintEngine *paintEngine() const Q_DECL_OVERRIDE; + QPaintEngine *paintEngine() const override; GLuint bindTexture(const QImage &image, GLenum target, GLint format, QGLContext::BindOptions options); @@ -437,7 +437,7 @@ public Q_SLOTS: virtual void updateOverlayGL(); protected: - bool event(QEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; virtual void initializeGL(); virtual void resizeGL(int w, int h); virtual void paintGL(); @@ -449,8 +449,8 @@ protected: void setAutoBufferSwap(bool on); bool autoBufferSwap() const; - void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent*) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent*) override; + void resizeEvent(QResizeEvent*) override; virtual void glInit(); virtual void glDraw(); diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 9ab5cd36a2..6b4d83888f 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -140,7 +140,7 @@ public: void initContext(QGLContext *context, const QGLWidget* shareWidget); bool renderCxPm(QPixmap *pixmap); void cleanupColormaps(); - void aboutToDestroy() Q_DECL_OVERRIDE { + void aboutToDestroy() override { if (glcx && !parent_changing) glcx->reset(); } @@ -488,12 +488,12 @@ public: } protected: - void invalidateResource() Q_DECL_OVERRIDE + void invalidateResource() override { m_id = 0; } - void freeResource(QOpenGLContext *context) Q_DECL_OVERRIDE + void freeResource(QOpenGLContext *context) override { if (m_id) { freeResource(QGLContext::fromOpenGLContext(context), m_id); @@ -517,7 +517,7 @@ public: } protected: - void freeResource(QGLContext *ctx, GLuint id) Q_DECL_OVERRIDE + void freeResource(QGLContext *ctx, GLuint id) override { m_func(ctx, id); } diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h index f4b6d1ddc1..c88063cbb5 100644 --- a/src/opengl/qglframebufferobject.h +++ b/src/opengl/qglframebufferobject.h @@ -84,7 +84,7 @@ public: QImage toImage() const; Attachment attachment() const; - QPaintEngine *paintEngine() const Q_DECL_OVERRIDE; + QPaintEngine *paintEngine() const override; GLuint handle() const; static bool bindDefault(); @@ -101,8 +101,8 @@ public: GLenum filter = GL_NEAREST); protected: - int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE; - int devType() const Q_DECL_OVERRIDE { return QInternal::FramebufferObject; } + int metric(PaintDeviceMetric metric) const override; + int devType() const override { return QInternal::FramebufferObject; } private: Q_DISABLE_COPY(QGLFramebufferObject) diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index d3af1fdbaa..bf5e21cf0b 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -106,11 +106,11 @@ public: class QGLFBOGLPaintDevice : public QGLPaintDevice { public: - virtual QPaintEngine* paintEngine() const Q_DECL_OVERRIDE {return fbo->paintEngine();} - virtual QSize size() const Q_DECL_OVERRIDE {return fbo->size();} - virtual QGLContext* context() const Q_DECL_OVERRIDE; - virtual QGLFormat format() const Q_DECL_OVERRIDE {return fboFormat;} - virtual bool alphaRequested() const Q_DECL_OVERRIDE { return reqAlpha; } + virtual QPaintEngine* paintEngine() const override {return fbo->paintEngine();} + virtual QSize size() const override {return fbo->size();} + virtual QGLContext* context() const override; + virtual QGLFormat format() const override {return fboFormat;} + virtual bool alphaRequested() const override { return reqAlpha; } void setFBO(QGLFramebufferObject* f, QGLFramebufferObject::Attachment attachment); diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index a1ea1b1e56..07e1194342 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -159,12 +159,12 @@ struct QGLFunctionsPrivateEx : public QGLFunctionsPrivate, public QOpenGLSharedR delete funcs; } - void invalidateResource() Q_DECL_OVERRIDE + void invalidateResource() override { m_features = -1; } - void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE + void freeResource(QOpenGLContext *) override { // no gl resources to free } diff --git a/src/opengl/qglpaintdevice_p.h b/src/opengl/qglpaintdevice_p.h index 3b34b2d244..bfecdabd53 100644 --- a/src/opengl/qglpaintdevice_p.h +++ b/src/opengl/qglpaintdevice_p.h @@ -64,7 +64,7 @@ public: QGLPaintDevice(); virtual ~QGLPaintDevice(); - int devType() const Q_DECL_OVERRIDE {return QInternal::OpenGL;} + int devType() const override {return QInternal::OpenGL;} virtual void beginPaint(); virtual void ensureActiveTarget(); @@ -80,7 +80,7 @@ public: static QGLPaintDevice* getDevice(QPaintDevice*); protected: - int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE; + int metric(QPaintDevice::PaintDeviceMetric metric) const override; GLuint m_previousFBO; GLuint m_thisFBO; }; @@ -93,13 +93,13 @@ class Q_OPENGL_EXPORT QGLWidgetGLPaintDevice : public QGLPaintDevice public: QGLWidgetGLPaintDevice(); - virtual QPaintEngine* paintEngine() const Q_DECL_OVERRIDE; + virtual QPaintEngine* paintEngine() const override; // QGLWidgets need to do swapBufers in endPaint: - virtual void beginPaint() Q_DECL_OVERRIDE; - virtual void endPaint() Q_DECL_OVERRIDE; - virtual QSize size() const Q_DECL_OVERRIDE; - virtual QGLContext* context() const Q_DECL_OVERRIDE; + virtual void beginPaint() override; + virtual void endPaint() override; + virtual QSize size() const override; + virtual QGLContext* context() const override; void setWidget(QGLWidget*); diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h index bd30ca2663..9735f51e4f 100644 --- a/src/opengl/qglpixelbuffer.h +++ b/src/opengl/qglpixelbuffer.h @@ -81,14 +81,14 @@ public: Qt::HANDLE handle() const; QImage toImage() const; - QPaintEngine *paintEngine() const Q_DECL_OVERRIDE; + QPaintEngine *paintEngine() const override; QGLFormat format() const; static bool hasOpenGLPbuffers(); protected: - int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE; - int devType() const Q_DECL_OVERRIDE { return QInternal::Pbuffer; } + int metric(PaintDeviceMetric metric) const override; + int devType() const override { return QInternal::Pbuffer; } private: Q_DISABLE_COPY(QGLPixelBuffer) diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index 218f4af866..cf3d307d71 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -143,7 +143,7 @@ public: setSource(source); } - void setUniforms(QGLShaderProgram *program) Q_DECL_OVERRIDE; + void setUniforms(QGLShaderProgram *program) override; QGraphicsShaderEffect *effect; }; diff --git a/src/opengl/qgraphicsshadereffect_p.h b/src/opengl/qgraphicsshadereffect_p.h index d7e0ec51d4..9efcecd25f 100644 --- a/src/opengl/qgraphicsshadereffect_p.h +++ b/src/opengl/qgraphicsshadereffect_p.h @@ -74,7 +74,7 @@ public: void setPixelShaderFragment(const QByteArray& code); protected: - void draw(QPainter *painter) Q_DECL_OVERRIDE; + void draw(QPainter *painter) override; void setUniformsDirty(); virtual void setUniforms(QGLShaderProgram *program); |