Fix 590 inconsistent override warnings [-Winconsistent-missing-override]
authorSérgio Martins <sergio.martins@kdab.com>
Wed, 4 Feb 2015 23:10:21 +0000 (23:10 +0000)
committerSérgio Martins <sergio.martins@kdab.com>
Fri, 13 Feb 2015 13:52:05 +0000 (13:52 +0000)
Classes should either use or not use override, otherwise it hurts
code readability.

Change-Id: Ieb899a3475b0c36ab20285740b2cec2cd1677a54
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/quick/items/context2d/qquickcontext2dtexture_p.h
src/quick/items/qquickitem.h
src/quick/items/qquicktextedit_p.h
src/quick/items/qquicktextinput_p.h
src/quick/items/qquickwindow.h
src/quick/scenegraph/qsgdefaultlayer_p.h

index 97d7e65..88d7b68 100644 (file)
@@ -165,21 +165,21 @@ class QQuickContext2DFBOTexture : public QQuickContext2DTexture
 public:
     QQuickContext2DFBOTexture();
     ~QQuickContext2DFBOTexture();
-    virtual QQuickContext2DTile* createTile() const;
-    virtual QPaintDevice* beginPainting();
-    virtual void endPainting();
+    QQuickContext2DTile* createTile() const Q_DECL_OVERRIDE;
+    QPaintDevice* beginPainting() Q_DECL_OVERRIDE;
+    void endPainting() Q_DECL_OVERRIDE;
     QRectF normalizedTextureSubRect() const;
-    virtual QQuickCanvasItem::RenderTarget renderTarget() const;
-    virtual void compositeTile(QQuickContext2DTile* tile);
-    QSize adjustedTileSize(const QSize &ts);
+    QQuickCanvasItem::RenderTarget renderTarget() const Q_DECL_OVERRIDE;
+    void compositeTile(QQuickContext2DTile* tile) Q_DECL_OVERRIDE;
+    QSize adjustedTileSize(const QSize &ts) Q_DECL_OVERRIDE;
 
-    QSGTexture *textureForNextFrame(QSGTexture *, QQuickWindow *window);
+    QSGTexture *textureForNextFrame(QSGTexture *, QQuickWindow *window) Q_DECL_OVERRIDE;
 
 protected:
     QVector2D scaleFactor() const Q_DECL_OVERRIDE;
 
 public Q_SLOTS:
-    virtual void grabImage(const QRectF& region = QRectF());
+    void grabImage(const QRectF& region = QRectF()) Q_DECL_OVERRIDE;
 
 private:
     bool doMultisampling() const;
index 36c72a9..4631133 100644 (file)
@@ -389,8 +389,8 @@ protected:
     bool heightValid() const; // ### better name?
     void setImplicitSize(qreal, qreal);
 
-    virtual void classBegin();
-    virtual void componentComplete();
+    void classBegin() Q_DECL_OVERRIDE;
+    void componentComplete() Q_DECL_OVERRIDE;
 
     virtual void keyPressEvent(QKeyEvent *event);
     virtual void keyReleaseEvent(QKeyEvent *event);
index 3d4d29b..bf6763f 100644 (file)
@@ -343,7 +343,7 @@ protected:
     void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE;
 #endif
     QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE;
-    void updatePolish();
+    void updatePolish() Q_DECL_OVERRIDE;
 
     friend class QQuickTextUtil;
     friend class QQuickTextDocument;
index 022e624..78e6a6b 100644 (file)
@@ -322,7 +322,7 @@ protected:
     void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
     void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
     QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE;
-    void updatePolish();
+    void updatePolish() Q_DECL_OVERRIDE;
 
 public Q_SLOTS:
     void selectAll();
index 294781e..f7a1956 100644 (file)
@@ -95,7 +95,7 @@ public:
     QQuickItem *contentItem() const;
 
     QQuickItem *activeFocusItem() const;
-    QObject *focusObject() const;
+    QObject *focusObject() const Q_DECL_OVERRIDE;
 
     QQuickItem *mouseGrabberItem() const;
 
index e6c7b65..f3d58ac 100644 (file)
@@ -50,41 +50,41 @@ public:
 
     // The item's "paint node", not effect node.
     QSGNode *item() const { return m_item; }
-    void setItem(QSGNode *item);
+    void setItem(QSGNode *item) Q_DECL_OVERRIDE;
 
     QRectF rect() const { return m_rect; }
-    void setRect(const QRectF &rect);
+    void setRect(const QRectF &rect) Q_DECL_OVERRIDE;
 
     QSize size() const { return m_size; }
-    void setSize(const QSize &size);
+    void setSize(const QSize &size) Q_DECL_OVERRIDE;
 
-    void setHasMipmaps(bool mipmap);
+    void setHasMipmaps(bool mipmap) Q_DECL_OVERRIDE;
 
-    void bind();
+    void bind() Q_DECL_OVERRIDE;
 
-    bool hasAlphaChannel() const;
-    bool hasMipmaps() const;
-    int textureId() const;
-    QSize textureSize() const { return m_size; }
+    bool hasAlphaChannel() const Q_DECL_OVERRIDE;
+    bool hasMipmaps() const Q_DECL_OVERRIDE;
+    int textureId() const Q_DECL_OVERRIDE;
+    QSize textureSize() const Q_DECL_OVERRIDE { return m_size; }
 
     GLenum format() const { return m_format; }
-    void setFormat(GLenum format);
+    void setFormat(GLenum format) Q_DECL_OVERRIDE;
 
     bool live() const { return bool(m_live); }
-    void setLive(bool live);
+    void setLive(bool live) Q_DECL_OVERRIDE;
 
     bool recursive() const { return bool(m_recursive); }
-    void setRecursive(bool recursive);
+    void setRecursive(bool recursive) Q_DECL_OVERRIDE;
 
-    void setDevicePixelRatio(qreal ratio) { m_device_pixel_ratio = ratio; }
+    void setDevicePixelRatio(qreal ratio) Q_DECL_OVERRIDE { m_device_pixel_ratio = ratio; }
 
-    void scheduleUpdate();
+    void scheduleUpdate() Q_DECL_OVERRIDE;
 
-    QImage toImage() const;
+    QImage toImage() const Q_DECL_OVERRIDE;
 
 public Q_SLOTS:
-    void markDirtyTexture();
-    void invalidated();
+    void markDirtyTexture() Q_DECL_OVERRIDE;
+    void invalidated() Q_DECL_OVERRIDE;
 
 private:
     void grab();