diff options
author | Olivier Goffart <[email protected]> | 2014-07-14 09:13:02 +0200 |
---|---|---|
committer | Olivier Goffart <[email protected]> | 2014-07-15 08:44:44 +0200 |
commit | 3b0c2b7c1b3ccdfe6867884a7e210bfc63e10f84 (patch) | |
tree | 4c75a4fa9f023c4bfc6746a4412922a8efe3b017 | |
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 <[email protected]>
195 files changed, 740 insertions, 740 deletions
diff --git a/examples/gui/analogclock/main.cpp b/examples/gui/analogclock/main.cpp index 1e10fcd07ba..d51f440dff0 100644 --- a/examples/gui/analogclock/main.cpp +++ b/examples/gui/analogclock/main.cpp @@ -49,8 +49,8 @@ public: AnalogClockWindow(); protected: - void timerEvent(QTimerEvent *); - void render(QPainter *p); + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; + void render(QPainter *p) Q_DECL_OVERRIDE; private: int m_timerId; diff --git a/examples/gui/openglwindow/main.cpp b/examples/gui/openglwindow/main.cpp index aa1c6d7fa1f..0b0a0e19f0c 100644 --- a/examples/gui/openglwindow/main.cpp +++ b/examples/gui/openglwindow/main.cpp @@ -53,8 +53,8 @@ class TriangleWindow : public OpenGLWindow public: TriangleWindow(); - void initialize(); - void render(); + void initialize() Q_DECL_OVERRIDE; + void render() Q_DECL_OVERRIDE; private: GLuint loadShader(GLenum type, const char *source); diff --git a/examples/gui/openglwindow/openglwindow.h b/examples/gui/openglwindow/openglwindow.h index f6b53e3b33d..cee888250b0 100644 --- a/examples/gui/openglwindow/openglwindow.h +++ b/examples/gui/openglwindow/openglwindow.h @@ -67,9 +67,9 @@ public slots: void renderNow(); protected: - bool event(QEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; - void exposeEvent(QExposeEvent *event); + void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE; private: bool m_update_pending; diff --git a/examples/gui/rasterwindow/rasterwindow.h b/examples/gui/rasterwindow/rasterwindow.h index 8dc39938499..bca73c19e75 100644 --- a/examples/gui/rasterwindow/rasterwindow.h +++ b/examples/gui/rasterwindow/rasterwindow.h @@ -57,10 +57,10 @@ public slots: void renderNow(); protected: - bool event(QEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event); - void exposeEvent(QExposeEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE; private: QBackingStore *m_backingStore; diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h index 8d262cb6937..a42c20495d9 100644 --- a/examples/network/bearermonitor/sessionwidget.h +++ b/examples/network/bearermonitor/sessionwidget.h @@ -59,7 +59,7 @@ public: explicit SessionWidget(const QNetworkConfiguration &config, QWidget *parent = 0); ~SessionWidget(); - void timerEvent(QTimerEvent *); + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; private: void updateSessionState(QNetworkSession::State state); diff --git a/examples/network/blockingfortuneclient/fortunethread.h b/examples/network/blockingfortuneclient/fortunethread.h index b0c7301b878..1986873dd9d 100644 --- a/examples/network/blockingfortuneclient/fortunethread.h +++ b/examples/network/blockingfortuneclient/fortunethread.h @@ -55,7 +55,7 @@ public: ~FortuneThread(); void requestNewFortune(const QString &hostName, quint16 port); - void run(); + void run() Q_DECL_OVERRIDE; signals: void newFortune(const QString &fortune); diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h index b86f6929ebe..818a0512e2d 100644 --- a/examples/network/googlesuggest/googlesuggest.h +++ b/examples/network/googlesuggest/googlesuggest.h @@ -60,7 +60,7 @@ class GSuggestCompletion : public QObject public: GSuggestCompletion(QLineEdit *parent = 0); ~GSuggestCompletion(); - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE; void showCompletion(const QStringList &choices, const QStringList &hits); public slots: diff --git a/examples/network/network-chat/connection.h b/examples/network/network-chat/connection.h index ee61052fafc..2a0603a46f9 100644 --- a/examples/network/network-chat/connection.h +++ b/examples/network/network-chat/connection.h @@ -78,7 +78,7 @@ signals: void newMessage(const QString &from, const QString &message); protected: - void timerEvent(QTimerEvent *timerEvent); + void timerEvent(QTimerEvent *timerEvent) Q_DECL_OVERRIDE; private slots: void processReadyRead(); diff --git a/examples/network/network-chat/server.h b/examples/network/network-chat/server.h index ec22981f30d..971eafe10c5 100644 --- a/examples/network/network-chat/server.h +++ b/examples/network/network-chat/server.h @@ -56,7 +56,7 @@ signals: void newConnection(Connection *connection); protected: - void incomingConnection(qintptr socketDescriptor); + void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE; }; #endif diff --git a/examples/network/threadedfortuneserver/fortuneserver.h b/examples/network/threadedfortuneserver/fortuneserver.h index 2efe2d62077..c49b9058f46 100644 --- a/examples/network/threadedfortuneserver/fortuneserver.h +++ b/examples/network/threadedfortuneserver/fortuneserver.h @@ -53,7 +53,7 @@ public: FortuneServer(QObject *parent = 0); protected: - void incomingConnection(qintptr socketDescriptor); + void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE; private: QStringList fortunes; diff --git a/examples/network/threadedfortuneserver/fortunethread.h b/examples/network/threadedfortuneserver/fortunethread.h index c02d8b48f6f..569d35aef83 100644 --- a/examples/network/threadedfortuneserver/fortunethread.h +++ b/examples/network/threadedfortuneserver/fortunethread.h @@ -52,7 +52,7 @@ class FortuneThread : public QThread public: FortuneThread(int socketDescriptor, const QString &fortune, QObject *parent); - void run(); + void run() Q_DECL_OVERRIDE; signals: void error(QTcpSocket::SocketError socketError); diff --git a/examples/network/torrent/filemanager.h b/examples/network/torrent/filemanager.h index 41f1aa9a40d..81b0321ae52 100644 --- a/examples/network/torrent/filemanager.h +++ b/examples/network/torrent/filemanager.h @@ -90,7 +90,7 @@ signals: void pieceVerified(int pieceIndex, bool verified); protected: - void run(); + void run() Q_DECL_OVERRIDE; private slots: bool verifySinglePiece(int pieceIndex); diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp index 3ac7d9dfdd7..fe7bbdaf3b8 100644 --- a/examples/network/torrent/mainwindow.cpp +++ b/examples/network/torrent/mainwindow.cpp @@ -57,8 +57,8 @@ signals: void fileDropped(const QString &fileName); protected: - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; #endif }; @@ -69,8 +69,8 @@ class TorrentViewDelegate : public QItemDelegate public: inline TorrentViewDelegate(MainWindow *mainWindow) : QItemDelegate(mainWindow) {} - inline void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index ) const + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index ) const Q_DECL_OVERRIDE { if (index.column() != 2) { QItemDelegate::paint(painter, option, index); diff --git a/examples/network/torrent/mainwindow.h b/examples/network/torrent/mainwindow.h index 6ba42be81f7..1862d857ffb 100644 --- a/examples/network/torrent/mainwindow.h +++ b/examples/network/torrent/mainwindow.h @@ -63,11 +63,11 @@ class MainWindow : public QMainWindow public: MainWindow(QWidget *parent = 0); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; const TorrentClient *clientForRow(int row) const; protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void loadSettings(); diff --git a/examples/network/torrent/peerwireclient.h b/examples/network/torrent/peerwireclient.h index 35e4cc6ffbb..12ce0696f6d 100644 --- a/examples/network/torrent/peerwireclient.h +++ b/examples/network/torrent/peerwireclient.h @@ -112,14 +112,14 @@ public: qint64 uploadSpeed() const; bool canTransferMore() const; - qint64 bytesAvailable() const { return incomingBuffer.size() + QTcpSocket::bytesAvailable(); } + qint64 bytesAvailable() const Q_DECL_OVERRIDE { return incomingBuffer.size() + QTcpSocket::bytesAvailable(); } qint64 socketBytesAvailable() const { return socket.bytesAvailable(); } qint64 socketBytesToWrite() const { return socket.bytesToWrite(); } - void setReadBufferSize(qint64 size); + void setReadBufferSize(qint64 size) Q_DECL_OVERRIDE; void connectToHost(const QHostAddress &address, - quint16 port, OpenMode openMode = ReadWrite); + quint16 port, OpenMode openMode = ReadWrite) Q_DECL_OVERRIDE; void diconnectFromHost(); signals: @@ -138,11 +138,11 @@ signals: void bytesReceived(qint64 size); protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - qint64 readData(char *data, qint64 maxlen); - qint64 readLineData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); + qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE; + qint64 readLineData(char *data, qint64 maxlen) Q_DECL_OVERRIDE; + qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE; private slots: void sendHandShake(); diff --git a/examples/network/torrent/torrentclient.h b/examples/network/torrent/torrentclient.h index 7f48d1697c9..ef9c99aea16 100644 --- a/examples/network/torrent/torrentclient.h +++ b/examples/network/torrent/torrentclient.h @@ -158,7 +158,7 @@ public slots: void setupIncomingConnection(PeerWireClient *client); protected slots: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; private slots: // File management diff --git a/examples/network/torrent/torrentserver.h b/examples/network/torrent/torrentserver.h index 50cc99c7d65..0f1be50c5b4 100644 --- a/examples/network/torrent/torrentserver.h +++ b/examples/network/torrent/torrentserver.h @@ -58,7 +58,7 @@ public: void removeClient(TorrentClient *client); protected: - void incomingConnection(qintptr socketDescriptor); + void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE; private slots: void removeClient(); diff --git a/examples/network/torrent/trackerclient.h b/examples/network/torrent/trackerclient.h index 6647422e3fa..da8b457b0f5 100644 --- a/examples/network/torrent/trackerclient.h +++ b/examples/network/torrent/trackerclient.h @@ -78,7 +78,7 @@ signals: void stopped(); protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; private slots: void fetchPeerList(); diff --git a/examples/opengl/2dpainting/glwidget.h b/examples/opengl/2dpainting/glwidget.h index 0e6786a3081..fec1be12f70 100644 --- a/examples/opengl/2dpainting/glwidget.h +++ b/examples/opengl/2dpainting/glwidget.h @@ -57,7 +57,7 @@ public slots: void animate(); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: Helper *helper; diff --git a/examples/opengl/2dpainting/widget.h b/examples/opengl/2dpainting/widget.h index 474ce2be3d7..9e2602e73c1 100644 --- a/examples/opengl/2dpainting/widget.h +++ b/examples/opengl/2dpainting/widget.h @@ -57,7 +57,7 @@ public slots: void animate(); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: Helper *helper; diff --git a/examples/opengl/cube/mainwidget.h b/examples/opengl/cube/mainwidget.h index 2e6b6bcc77f..92b3aabf46e 100644 --- a/examples/opengl/cube/mainwidget.h +++ b/examples/opengl/cube/mainwidget.h @@ -63,13 +63,13 @@ public: ~MainWidget(); protected: - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void timerEvent(QTimerEvent *e); + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); + void initializeGL() Q_DECL_OVERRIDE; + void resizeGL(int w, int h) Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; void initShaders(); void initTextures(); diff --git a/examples/opengl/framebufferobject2/glwidget.h b/examples/opengl/framebufferobject2/glwidget.h index f3f7640d285..2991a4fdf2a 100644 --- a/examples/opengl/framebufferobject2/glwidget.h +++ b/examples/opengl/framebufferobject2/glwidget.h @@ -45,12 +45,12 @@ class GLWidget : public QGLWidget public: GLWidget(QWidget *parent); ~GLWidget(); - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); - void timerEvent(QTimerEvent *) { update(); } - void mousePressEvent(QMouseEvent *) { killTimer(timerId); } - void mouseReleaseEvent(QMouseEvent *) { timerId = startTimer(20); } + void initializeGL() Q_DECL_OVERRIDE; + void resizeGL(int w, int h) Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE { update(); } + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE { killTimer(timerId); } + void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE { timerId = startTimer(20); } void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp); diff --git a/examples/opengl/grabber/glwidget.h b/examples/opengl/grabber/glwidget.h index 976d22a4219..12071be1736 100644 --- a/examples/opengl/grabber/glwidget.h +++ b/examples/opengl/grabber/glwidget.h @@ -66,11 +66,11 @@ signals: void zRotationChanged(int angle); protected: - void initializeGL(); - void paintGL(); - void resizeGL(int width, int height); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); + void initializeGL() Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void resizeGL(int width, int height) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private slots: void advanceGears(); diff --git a/examples/opengl/hellogl/glwidget.h b/examples/opengl/hellogl/glwidget.h index 3344e931e75..0989be1dc6d 100644 --- a/examples/opengl/hellogl/glwidget.h +++ b/examples/opengl/hellogl/glwidget.h @@ -54,8 +54,8 @@ public: GLWidget(QWidget *parent = 0); ~GLWidget(); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; //! [0] //! [1] @@ -72,11 +72,11 @@ signals: //! [2] protected: - void initializeGL(); - void paintGL(); - void resizeGL(int width, int height); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); + void initializeGL() Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void resizeGL(int width, int height) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; //! [2] //! [3] diff --git a/examples/opengl/hellogl/window.h b/examples/opengl/hellogl/window.h index 68862fbcfed..900e6b13fce 100644 --- a/examples/opengl/hellogl/window.h +++ b/examples/opengl/hellogl/window.h @@ -57,7 +57,7 @@ public: Window(); protected: - void keyPressEvent(QKeyEvent *event); + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; private: QSlider *createSlider(); diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h index 6d66f0204ac..9fb7d109b91 100644 --- a/examples/opengl/hellowindow/hellowindow.h +++ b/examples/opengl/hellowindow/hellowindow.h @@ -98,10 +98,10 @@ public: QColor color() const; void updateColor(); - void exposeEvent(QExposeEvent *event); + void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE; private: - void mousePressEvent(QMouseEvent *); + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; int m_colorIndex; QColor m_color; diff --git a/examples/opengl/overpainting/glwidget.h b/examples/opengl/overpainting/glwidget.h index cd3a125b389..1d1d48458d0 100644 --- a/examples/opengl/overpainting/glwidget.h +++ b/examples/opengl/overpainting/glwidget.h @@ -57,7 +57,7 @@ public: ~GLWidget(); //! [0] - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; int xRotation() const { return xRot; } int yRotation() const { return yRot; } int zRotation() const { return zRot; } @@ -69,12 +69,12 @@ public slots: //! [1] protected: - void initializeGL(); - void paintEvent(QPaintEvent *event); - void resizeGL(int width, int height); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void showEvent(QShowEvent *event); + void initializeGL() Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeGL(int width, int height) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; private slots: void animate(); diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h index f185cd37336..140af6db4df 100644 --- a/examples/opengl/paintedwindow/paintedwindow.h +++ b/examples/opengl/paintedwindow/paintedwindow.h @@ -74,8 +74,8 @@ private slots: void rotationDone(); private: - void exposeEvent(QExposeEvent *); - void mousePressEvent(QMouseEvent *); + void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; void paint(QPainter *painter, const QRect &rect); diff --git a/examples/opengl/pbuffers/glwidget.h b/examples/opengl/pbuffers/glwidget.h index c4d71c0b76a..1d23b7772ab 100644 --- a/examples/opengl/pbuffers/glwidget.h +++ b/examples/opengl/pbuffers/glwidget.h @@ -57,11 +57,11 @@ public: ~GLWidget(); protected: - void initializeGL(); - void paintGL(); - void resizeGL(int width, int height); - void mousePressEvent(QMouseEvent *) { setAnimationPaused(true); } - void mouseReleaseEvent(QMouseEvent *) { setAnimationPaused(false); } + void initializeGL() Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void resizeGL(int width, int height) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE { setAnimationPaused(true); } + void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE { setAnimationPaused(false); } private: void initializeGeometry(); diff --git a/examples/opengl/samplebuffers/glwidget.h b/examples/opengl/samplebuffers/glwidget.h index 0e20b4dd4d4..494c5861dfc 100644 --- a/examples/opengl/samplebuffers/glwidget.h +++ b/examples/opengl/samplebuffers/glwidget.h @@ -46,10 +46,10 @@ public: GLWidget(QWidget *parent); protected: - void initializeGL(); - void resizeGL(int w, int h); - void paintGL(); - void timerEvent(QTimerEvent *); + void initializeGL() Q_DECL_OVERRIDE; + void resizeGL(int w, int h) Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; void makeObject(); void quad(GLenum primitive, GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2, diff --git a/examples/opengl/textures/glwidget.h b/examples/opengl/textures/glwidget.h index b210b0fd8fe..959dfdd5e7e 100644 --- a/examples/opengl/textures/glwidget.h +++ b/examples/opengl/textures/glwidget.h @@ -55,8 +55,8 @@ public: explicit GLWidget(QWidget *parent = 0, QGLWidget *shareWidget = 0); ~GLWidget(); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; void rotateBy(int xAngle, int yAngle, int zAngle); void setClearColor(const QColor &color); @@ -64,12 +64,12 @@ signals: void clicked(); protected: - void initializeGL(); - void paintGL(); - void resizeGL(int width, int height); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + void initializeGL() Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void resizeGL(int width, int height) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private: void makeObject(); diff --git a/examples/qpa/windows/window.h b/examples/qpa/windows/window.h index 88cf6db431c..f9abfc0821b 100644 --- a/examples/qpa/windows/window.h +++ b/examples/qpa/windows/window.h @@ -48,16 +48,16 @@ public: Window(QScreen *screen); protected: - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *); + void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void exposeEvent(QExposeEvent *); - void resizeEvent(QResizeEvent *); + void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *); + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; private: void render(); diff --git a/examples/sql/books/bookdelegate.h b/examples/sql/books/bookdelegate.h index 732e418ca42..b1de0546cb4 100644 --- a/examples/sql/books/bookdelegate.h +++ b/examples/sql/books/bookdelegate.h @@ -55,16 +55,16 @@ public: BookDelegate(QObject *parent); void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, - const QModelIndex &index); + const QModelIndex &index) Q_DECL_OVERRIDE; QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; private: QPixmap star; diff --git a/examples/sql/drilldown/imageitem.h b/examples/sql/drilldown/imageitem.h index 59f468e3a67..3935c157a72 100644 --- a/examples/sql/drilldown/imageitem.h +++ b/examples/sql/drilldown/imageitem.h @@ -56,8 +56,8 @@ public: int id(); protected: - void hoverEnterEvent(QGraphicsSceneHoverEvent *event); - void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); + void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; + void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; private slots: void setFrame(int frame); diff --git a/examples/sql/drilldown/view.h b/examples/sql/drilldown/view.h index c9fc040bb16..b7fb72fe748 100644 --- a/examples/sql/drilldown/view.h +++ b/examples/sql/drilldown/view.h @@ -56,7 +56,7 @@ public: View(const QString &items, const QString &images, QWidget *parent = 0); protected: - void mouseReleaseEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; //! [0] //! [1] diff --git a/examples/sql/querymodel/customsqlmodel.h b/examples/sql/querymodel/customsqlmodel.h index 63ab38f57fa..ec673305a82 100644 --- a/examples/sql/querymodel/customsqlmodel.h +++ b/examples/sql/querymodel/customsqlmodel.h @@ -51,7 +51,7 @@ class CustomSqlModel : public QSqlQueryModel public: CustomSqlModel(QObject *parent = 0); - QVariant data(const QModelIndex &item, int role) const; + QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/sql/querymodel/editablesqlmodel.h b/examples/sql/querymodel/editablesqlmodel.h index 53bb7ac908f..a1f3f1a3028 100644 --- a/examples/sql/querymodel/editablesqlmodel.h +++ b/examples/sql/querymodel/editablesqlmodel.h @@ -50,8 +50,8 @@ class EditableSqlModel : public QSqlQueryModel public: EditableSqlModel(QObject *parent = 0); - Qt::ItemFlags flags(const QModelIndex &index) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE; private: bool setFirstName(int personId, const QString &firstName); diff --git a/examples/sql/sqlbrowser/browser.h b/examples/sql/sqlbrowser/browser.h index db57404ec39..1819b90ce76 100644 --- a/examples/sql/sqlbrowser/browser.h +++ b/examples/sql/sqlbrowser/browser.h @@ -108,7 +108,7 @@ class CustomModel: public QSqlTableModel Q_OBJECT public: explicit CustomModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase()):QSqlTableModel(parent, db) {} - QVariant data(const QModelIndex &idx, int role) const + QVariant data(const QModelIndex &idx, int role) const Q_DECL_OVERRIDE { if (role == Qt::BackgroundRole && isDirty(idx)) return QBrush(QColor(Qt::yellow)); diff --git a/examples/threads/mandelbrot/mandelbrotwidget.h b/examples/threads/mandelbrot/mandelbrotwidget.h index 0867270305d..183edf2e269 100644 --- a/examples/threads/mandelbrot/mandelbrotwidget.h +++ b/examples/threads/mandelbrot/mandelbrotwidget.h @@ -55,15 +55,15 @@ public: MandelbrotWidget(QWidget *parent = 0); protected: - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); - void keyPressEvent(QKeyEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; #ifndef QT_NO_WHEELEVENT - void wheelEvent(QWheelEvent *event); + void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private slots: void updatePixmap(const QImage &image, double scaleFactor); diff --git a/examples/threads/mandelbrot/renderthread.h b/examples/threads/mandelbrot/renderthread.h index 9c1ab1828d3..881870665f7 100644 --- a/examples/threads/mandelbrot/renderthread.h +++ b/examples/threads/mandelbrot/renderthread.h @@ -65,7 +65,7 @@ signals: void renderedImage(const QImage &image, double scaleFactor); protected: - void run(); + void run() Q_DECL_OVERRIDE; private: uint rgbFromWaveLength(double wave); diff --git a/examples/threads/semaphores/semaphores.cpp b/examples/threads/semaphores/semaphores.cpp index fb7f1f2376a..f519e5f323d 100644 --- a/examples/threads/semaphores/semaphores.cpp +++ b/examples/threads/semaphores/semaphores.cpp @@ -58,7 +58,7 @@ class Producer : public QThread //! [1] //! [2] { public: - void run() + void run() Q_DECL_OVERRIDE { qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); for (int i = 0; i < DataSize; ++i) { @@ -76,7 +76,7 @@ class Consumer : public QThread { Q_OBJECT public: - void run() + void run() Q_DECL_OVERRIDE { for (int i = 0; i < DataSize; ++i) { usedBytes.acquire(); diff --git a/examples/threads/waitconditions/waitconditions.cpp b/examples/threads/waitconditions/waitconditions.cpp index 6f5f56e737f..b0336f4c2ba 100644 --- a/examples/threads/waitconditions/waitconditions.cpp +++ b/examples/threads/waitconditions/waitconditions.cpp @@ -64,7 +64,7 @@ public: { } - void run() + void run() Q_DECL_OVERRIDE { qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); @@ -95,7 +95,7 @@ public: { } - void run() + void run() Q_DECL_OVERRIDE { for (int i = 0; i < DataSize; ++i) { mutex.lock(); diff --git a/examples/tools/contiguouscache/randomlistmodel.h b/examples/tools/contiguouscache/randomlistmodel.h index 490cabddd78..3acafc23ffc 100644 --- a/examples/tools/contiguouscache/randomlistmodel.h +++ b/examples/tools/contiguouscache/randomlistmodel.h @@ -52,8 +52,8 @@ public: RandomListModel(QObject *parent = 0); ~RandomListModel(); - int rowCount(const QModelIndex & = QModelIndex()) const; - QVariant data(const QModelIndex &, int) const; + int rowCount(const QModelIndex & = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &, int) const Q_DECL_OVERRIDE; private: void cacheRows(int, int) const; diff --git a/examples/touch/fingerpaint/mainwindow.h b/examples/touch/fingerpaint/mainwindow.h index 4d97f7e13f1..997ea064f24 100644 --- a/examples/touch/fingerpaint/mainwindow.h +++ b/examples/touch/fingerpaint/mainwindow.h @@ -55,7 +55,7 @@ public: MainWindow(); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void open(); diff --git a/examples/touch/fingerpaint/scribblearea.h b/examples/touch/fingerpaint/scribblearea.h index e6c8e8d155a..2019bfc58fc 100644 --- a/examples/touch/fingerpaint/scribblearea.h +++ b/examples/touch/fingerpaint/scribblearea.h @@ -64,9 +64,9 @@ public slots: void print(); protected: - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); - bool event(QEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *event) Q_DECL_OVERRIDE; private: void resizeImage(QImage *image, const QSize &newSize); diff --git a/examples/touch/knobs/knob.h b/examples/touch/knobs/knob.h index 645e2174a8c..a3315a9b1dd 100644 --- a/examples/touch/knobs/knob.h +++ b/examples/touch/knobs/knob.h @@ -48,7 +48,7 @@ class Knob : public QGraphicsEllipseItem public: Knob(); - bool sceneEvent(QEvent *event); + bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE; }; #endif // KNOB_H diff --git a/examples/touch/pinchzoom/graphicsview.h b/examples/touch/pinchzoom/graphicsview.h index 5553f4b6d6f..63728acaf6c 100644 --- a/examples/touch/pinchzoom/graphicsview.h +++ b/examples/touch/pinchzoom/graphicsview.h @@ -48,7 +48,7 @@ class GraphicsView : public QGraphicsView public: GraphicsView(QGraphicsScene *scene = 0, QWidget *parent = 0); - bool viewportEvent(QEvent *event); + bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE; private: qreal totalScaleFactor; diff --git a/examples/touch/pinchzoom/mouse.h b/examples/touch/pinchzoom/mouse.h index 22b571b6929..9a705e50629 100644 --- a/examples/touch/pinchzoom/mouse.h +++ b/examples/touch/pinchzoom/mouse.h @@ -51,13 +51,13 @@ class Mouse : public QGraphicsObject public: Mouse(); - QRectF boundingRect() const; - QPainterPath shape() const; + QRectF boundingRect() const Q_DECL_OVERRIDE; + QPainterPath shape() const Q_DECL_OVERRIDE; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget); + QWidget *widget) Q_DECL_OVERRIDE; protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; private: qreal angle; diff --git a/examples/widgets/animation/animatedtiles/main.cpp b/examples/widgets/animation/animatedtiles/main.cpp index 6eab0189293..09e97906462 100644 --- a/examples/widgets/animation/animatedtiles/main.cpp +++ b/examples/widgets/animation/animatedtiles/main.cpp @@ -64,19 +64,19 @@ public: setCacheMode(DeviceCoordinateCache); } - QRectF boundingRect() const + QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(-65, -65, 130, 130); } - QPainterPath shape() const + QPainterPath shape() const Q_DECL_OVERRIDE { QPainterPath path; path.addEllipse(boundingRect()); return path; } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) Q_DECL_OVERRIDE { bool down = option->state & QStyle::State_Sunken; QRectF r = boundingRect(); @@ -101,13 +101,13 @@ signals: void pressed(); protected: - void mousePressEvent(QGraphicsSceneMouseEvent *) + void mousePressEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE { emit pressed(); update(); } - void mouseReleaseEvent(QGraphicsSceneMouseEvent *) + void mouseReleaseEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE { update(); } @@ -122,7 +122,7 @@ public: View(QGraphicsScene *scene) : QGraphicsView(scene) { } protected: - void resizeEvent(QResizeEvent *event) + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE { QGraphicsView::resizeEvent(event); fitInView(sceneRect(), Qt::KeepAspectRatio); diff --git a/examples/widgets/animation/appchooser/main.cpp b/examples/widgets/animation/appchooser/main.cpp index a65e998b326..652e458411c 100644 --- a/examples/widgets/animation/appchooser/main.cpp +++ b/examples/widgets/animation/appchooser/main.cpp @@ -52,17 +52,17 @@ public: { } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE { painter->drawPixmap(QPointF(), p); } - virtual void mousePressEvent(QGraphicsSceneMouseEvent * ) + virtual void mousePressEvent(QGraphicsSceneMouseEvent * ) Q_DECL_OVERRIDE { emit clicked(); } - virtual void setGeometry(const QRectF &rect) + virtual void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE { QGraphicsWidget::setGeometry(rect); @@ -88,7 +88,7 @@ public: { } - virtual void resizeEvent(QResizeEvent *) + virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE { fitInView(sceneRect(), Qt::KeepAspectRatio); } diff --git a/examples/widgets/animation/easing/animation.h b/examples/widgets/animation/easing/animation.h index d12a219abd6..296f4c9da19 100644 --- a/examples/widgets/animation/easing/animation.h +++ b/examples/widgets/animation/easing/animation.h @@ -67,7 +67,7 @@ public: m_path = QPainterPath(); } - void updateCurrentTime(int currentTime) + void updateCurrentTime(int currentTime) Q_DECL_OVERRIDE { if (m_pathType == CirclePath) { if (m_path.isEmpty()) { diff --git a/examples/widgets/animation/moveblocks/main.cpp b/examples/widgets/animation/moveblocks/main.cpp index 6d08381a539..57f13ceebe7 100644 --- a/examples/widgets/animation/moveblocks/main.cpp +++ b/examples/widgets/animation/moveblocks/main.cpp @@ -70,7 +70,7 @@ class QGraphicsRectWidget : public QGraphicsWidget { public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *, - QWidget *) + QWidget *) Q_DECL_OVERRIDE { painter->fillRect(rect(), Qt::blue); } @@ -88,14 +88,14 @@ public: protected: //![14] - virtual bool eventTest(QEvent *event) + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE { return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType)) && (static_cast<StateSwitchEvent *>(event)->rand() == m_rand); } //![14] - virtual void onTransition(QEvent *) {} + virtual void onTransition(QEvent *) Q_DECL_OVERRIDE {} private: int m_rand; @@ -112,7 +112,7 @@ public: //![10] //![11] - virtual void onEntry(QEvent *) + virtual void onEntry(QEvent *) Q_DECL_OVERRIDE { int n; while ((n = (qrand() % m_stateCount + 1)) == m_lastIndex) @@ -120,7 +120,7 @@ public: m_lastIndex = n; machine()->postEvent(new StateSwitchEvent(n)); } - virtual void onExit(QEvent *) {} + virtual void onExit(QEvent *) Q_DECL_OVERRIDE {} //![11] //![12] @@ -164,7 +164,7 @@ public: } protected: - virtual void resizeEvent(QResizeEvent *event) + virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE { fitInView(scene()->sceneRect()); QGraphicsView::resizeEvent(event); diff --git a/examples/widgets/animation/states/main.cpp b/examples/widgets/animation/states/main.cpp index fc633bd972a..8bc8535ece4 100644 --- a/examples/widgets/animation/states/main.cpp +++ b/examples/widgets/animation/states/main.cpp @@ -48,12 +48,12 @@ public: { } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE { painter->drawPixmap(QPointF(), p); } - QRectF boundingRect() const + QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF( QPointF(0, 0), p.size()); } @@ -69,7 +69,7 @@ public: { } - virtual void resizeEvent(QResizeEvent *) + virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE { fitInView(sceneRect(), Qt::KeepAspectRatio); } diff --git a/examples/widgets/animation/stickman/graphicsview.h b/examples/widgets/animation/stickman/graphicsview.h index 60abb6448f2..cdccbbfbd39 100644 --- a/examples/widgets/animation/stickman/graphicsview.h +++ b/examples/widgets/animation/stickman/graphicsview.h @@ -51,8 +51,8 @@ public: GraphicsView(QWidget *parent = 0); protected: - virtual void resizeEvent(QResizeEvent *event); - void keyPressEvent(QKeyEvent *); + virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; signals: void keyPressed(int key); diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp index 09ca45e55bf..7b089b5459b 100644 --- a/examples/widgets/animation/stickman/lifecycle.cpp +++ b/examples/widgets/animation/stickman/lifecycle.cpp @@ -60,7 +60,7 @@ public: setTargetState(target); } - virtual bool eventTest(QEvent *e) + virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE { if (QSignalTransition::eventTest(e)) { QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0); @@ -85,7 +85,7 @@ public: startTimer(1000); } - virtual bool eventTest(QEvent *e) + virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE { return QEventTransition::eventTest(e) && ((qrand() % 50) == 0); } diff --git a/examples/widgets/animation/stickman/node.h b/examples/widgets/animation/stickman/node.h index 9c7cc8d75a8..6da83d5474b 100644 --- a/examples/widgets/animation/stickman/node.h +++ b/examples/widgets/animation/stickman/node.h @@ -50,18 +50,18 @@ public: explicit Node(const QPointF &pos, QGraphicsItem *parent = 0); ~Node(); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; signals: void positionChanged(); protected: - QVariant itemChange(GraphicsItemChange change, const QVariant &value); + QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE; - void mousePressEvent(QGraphicsSceneMouseEvent *); - void mouseMoveEvent(QGraphicsSceneMouseEvent *); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *); + void mousePressEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE; + void mouseMoveEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *) Q_DECL_OVERRIDE; private: bool m_dragging; diff --git a/examples/widgets/animation/stickman/rectbutton.h b/examples/widgets/animation/stickman/rectbutton.h index 16c70fddd40..1cc9be2f970 100644 --- a/examples/widgets/animation/stickman/rectbutton.h +++ b/examples/widgets/animation/stickman/rectbutton.h @@ -50,13 +50,13 @@ public: RectButton(QString buttonText); ~RectButton(); - virtual QRectF boundingRect() const; - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual QRectF boundingRect() const Q_DECL_OVERRIDE; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: QString m_ButtonText; - virtual void mousePressEvent (QGraphicsSceneMouseEvent *event); + virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; signals: void clicked(); diff --git a/examples/widgets/animation/stickman/stickman.h b/examples/widgets/animation/stickman/stickman.h index 08928a48a62..d8538efc528 100644 --- a/examples/widgets/animation/stickman/stickman.h +++ b/examples/widgets/animation/stickman/stickman.h @@ -59,8 +59,8 @@ public: StickMan(); ~StickMan(); - virtual QRectF boundingRect() const; - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual QRectF boundingRect() const Q_DECL_OVERRIDE; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; int nodeCount() const; Node *node(int idx) const; @@ -82,7 +82,7 @@ public slots: void childPositionChanged(); protected: - void timerEvent(QTimerEvent *e); + void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; private: diff --git a/examples/widgets/animation/sub-attaq/boat.h b/examples/widgets/animation/sub-attaq/boat.h index 82f43572e82..561ba49d27a 100644 --- a/examples/widgets/animation/sub-attaq/boat.h +++ b/examples/widgets/animation/sub-attaq/boat.h @@ -77,7 +77,7 @@ public: void updateBoatMovement(); - virtual int type() const; + virtual int type() const Q_DECL_OVERRIDE; signals: void boatDestroyed(); diff --git a/examples/widgets/animation/sub-attaq/boat_p.h b/examples/widgets/animation/sub-attaq/boat_p.h index fc3ba81d630..19c5dad9ba9 100644 --- a/examples/widgets/animation/sub-attaq/boat_p.h +++ b/examples/widgets/animation/sub-attaq/boat_p.h @@ -72,7 +72,7 @@ public: { } protected: - virtual bool eventTest(QEvent *event) + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE { if (!QKeyEventTransition::eventTest(event)) return false; @@ -91,13 +91,13 @@ public: { } protected: - virtual bool eventTest(QEvent *event) + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE { if (!QKeyEventTransition::eventTest(event)) return false; return (boat->currentSpeed() >= 0); } - void onTransition(QEvent *) + void onTransition(QEvent *) Q_DECL_OVERRIDE { //We decrease the speed if needed if (key == Qt::Key_Left && boat->currentDirection() == Boat::Right) @@ -122,7 +122,7 @@ public: { } protected: - virtual bool eventTest(QEvent *event) + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE { if (!QKeyEventTransition::eventTest(event)) return false; @@ -141,7 +141,7 @@ public: { } protected: - void onEntry(QEvent *) + void onEntry(QEvent *) Q_DECL_OVERRIDE { boat->setCurrentDirection(Boat::Right); boat->updateBoatMovement(); @@ -158,7 +158,7 @@ public: { } protected: - void onEntry(QEvent *) + void onEntry(QEvent *) Q_DECL_OVERRIDE { boat->setCurrentDirection(Boat::Left); boat->updateBoatMovement(); @@ -175,7 +175,7 @@ public: { } protected: - void onEntry(QEvent *) + void onEntry(QEvent *) Q_DECL_OVERRIDE { boat->setCurrentSpeed(0); boat->setCurrentDirection(Boat::None); @@ -193,7 +193,7 @@ public: { } protected: - void onEntry(QEvent *) + void onEntry(QEvent *) Q_DECL_OVERRIDE { Bomb *b = new Bomb(); b->setPos(boat->x()+boat->size().width(),boat->y()); @@ -214,7 +214,7 @@ public: { } protected: - void onEntry(QEvent *) + void onEntry(QEvent *) Q_DECL_OVERRIDE { Bomb *b = new Bomb(); b->setPos(boat->x() - b->size().width(), boat->y()); diff --git a/examples/widgets/animation/sub-attaq/pixmapitem.h b/examples/widgets/animation/sub-attaq/pixmapitem.h index e093fbd5b5c..baca0c1cba9 100644 --- a/examples/widgets/animation/sub-attaq/pixmapitem.h +++ b/examples/widgets/animation/sub-attaq/pixmapitem.h @@ -54,8 +54,8 @@ public: PixmapItem(const QString &fileName, GraphicsScene::Mode mode, QGraphicsItem * parent = 0); PixmapItem(const QString &fileName, QGraphicsScene *scene); QSizeF size() const; - QRectF boundingRect() const; - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE; private: QPixmap pix; }; diff --git a/examples/widgets/animation/sub-attaq/qanimationstate.h b/examples/widgets/animation/sub-attaq/qanimationstate.h index 68eac43e132..c2b7e122115 100644 --- a/examples/widgets/animation/sub-attaq/qanimationstate.h +++ b/examples/widgets/animation/sub-attaq/qanimationstate.h @@ -71,9 +71,9 @@ signals: void animationFinished(); protected: - void onEntry(QEvent *); - void onExit(QEvent *); - bool event(QEvent *e); + void onEntry(QEvent *) Q_DECL_OVERRIDE; + void onExit(QEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *e) Q_DECL_OVERRIDE; private: Q_DISABLE_COPY(QAnimationState) diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h index 3cd27be9a4b..19016cb76e9 100644 --- a/examples/widgets/animation/sub-attaq/states.h +++ b/examples/widgets/animation/sub-attaq/states.h @@ -63,7 +63,7 @@ public: ~PlayState(); protected: - void onEntry(QEvent *); + void onEntry(QEvent *) Q_DECL_OVERRIDE; private : GraphicsScene *scene; @@ -85,7 +85,7 @@ class LevelState : public QState public: LevelState(GraphicsScene *scene, PlayState *game, QState *parent = 0); protected: - void onEntry(QEvent *); + void onEntry(QEvent *) Q_DECL_OVERRIDE; private : void initializeLevel(); GraphicsScene *scene; @@ -98,8 +98,8 @@ public: explicit PauseState(GraphicsScene *scene, QState *parent = 0); protected: - void onEntry(QEvent *); - void onExit(QEvent *); + void onEntry(QEvent *) Q_DECL_OVERRIDE; + void onExit(QEvent *) Q_DECL_OVERRIDE; private : GraphicsScene *scene; }; @@ -110,8 +110,8 @@ public: LostState(GraphicsScene *scene, PlayState *game, QState *parent = 0); protected: - void onEntry(QEvent *); - void onExit(QEvent *); + void onEntry(QEvent *) Q_DECL_OVERRIDE; + void onExit(QEvent *) Q_DECL_OVERRIDE; private : GraphicsScene *scene; PlayState *game; @@ -123,8 +123,8 @@ public: WinState(GraphicsScene *scene, PlayState *game, QState *parent = 0); protected: - void onEntry(QEvent *); - void onExit(QEvent *); + void onEntry(QEvent *) Q_DECL_OVERRIDE; + void onExit(QEvent *) Q_DECL_OVERRIDE; private : GraphicsScene *scene; PlayState *game; @@ -143,7 +143,7 @@ class UpdateScoreTransition : public QSignalTransition public: UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target); protected: - virtual bool eventTest(QEvent *event); + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE; private: PlayState * game; GraphicsScene *scene; @@ -155,7 +155,7 @@ class WinTransition : public QSignalTransition public: WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target); protected: - virtual bool eventTest(QEvent *event); + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE; private: PlayState * game; GraphicsScene *scene; @@ -167,7 +167,7 @@ private: public: CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key); protected: - virtual bool eventTest(QEvent *event); + virtual bool eventTest(QEvent *event) Q_DECL_OVERRIDE; private: PlayState *game; }; diff --git a/examples/widgets/animation/sub-attaq/submarine.h b/examples/widgets/animation/sub-attaq/submarine.h index 802bf6f81cc..b087d0178d3 100644 --- a/examples/widgets/animation/sub-attaq/submarine.h +++ b/examples/widgets/animation/sub-attaq/submarine.h @@ -72,7 +72,7 @@ public: void launchTorpedo(int speed); void destroy(); - virtual int type() const; + virtual int type() const Q_DECL_OVERRIDE; QGraphicsRotation *rotation() const { return graphicsRotation; } diff --git a/examples/widgets/animation/sub-attaq/submarine_p.h b/examples/widgets/animation/sub-attaq/submarine_p.h index e1755505df0..f117be7b8c0 100644 --- a/examples/widgets/animation/sub-attaq/submarine_p.h +++ b/examples/widgets/animation/sub-attaq/submarine_p.h @@ -84,7 +84,7 @@ protected slots: } protected: - void onEntry(QEvent *e) + void onEntry(QEvent *e) Q_DECL_OVERRIDE { if (submarine->currentDirection() == SubMarine::Left) { movementAnimation->setEndValue(QPointF(0,submarine->y())); @@ -116,14 +116,14 @@ public: } protected: - void onEntry(QEvent *e) + void onEntry(QEvent *e) Q_DECL_OVERRIDE { returnAnimation->stop(); returnAnimation->setEndValue(submarine->currentDirection() == SubMarine::Right ? 360. : 180.); QAnimationState::onEntry(e); } - void onExit(QEvent *e) + void onExit(QEvent *e) Q_DECL_OVERRIDE { submarine->currentDirection() == SubMarine::Right ? submarine->setCurrentDirection(SubMarine::Left) : submarine->setCurrentDirection(SubMarine::Right); QAnimationState::onExit(e); diff --git a/examples/widgets/desktop/screenshot/screenshot.h b/examples/widgets/desktop/screenshot/screenshot.h index 2331feeaec0..6ad42813351 100644 --- a/examples/widgets/desktop/screenshot/screenshot.h +++ b/examples/widgets/desktop/screenshot/screenshot.h @@ -64,7 +64,7 @@ public: Screenshot(); protected: - void resizeEvent(QResizeEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private slots: void newScreenshot(); diff --git a/examples/widgets/desktop/systray/window.h b/examples/widgets/desktop/systray/window.h index c93228754b1..24d0d3ae18c 100644 --- a/examples/widgets/desktop/systray/window.h +++ b/examples/widgets/desktop/systray/window.h @@ -68,10 +68,10 @@ class Window : public QDialog public: Window(); - void setVisible(bool visible); + void setVisible(bool visible) Q_DECL_OVERRIDE; protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void setIcon(int index); diff --git a/examples/widgets/dialogs/classwizard/classwizard.h b/examples/widgets/dialogs/classwizard/classwizard.h index 34a35a2ce95..a709fd3405c 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.h +++ b/examples/widgets/dialogs/classwizard/classwizard.h @@ -59,7 +59,7 @@ class ClassWizard : public QWizard public: ClassWizard(QWidget *parent = 0); - void accept(); + void accept() Q_DECL_OVERRIDE; }; //! [0] @@ -107,7 +107,7 @@ public: CodeStylePage(QWidget *parent = 0); protected: - void initializePage(); + void initializePage() Q_DECL_OVERRIDE; private: QCheckBox *commentCheckBox; @@ -128,7 +128,7 @@ public: OutputFilesPage(QWidget *parent = 0); protected: - void initializePage(); + void initializePage() Q_DECL_OVERRIDE; private: QLabel *outputDirLabel; @@ -147,7 +147,7 @@ public: ConclusionPage(QWidget *parent = 0); protected: - void initializePage(); + void initializePage() Q_DECL_OVERRIDE; private: QLabel *label; diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.h b/examples/widgets/dialogs/licensewizard/licensewizard.h index a6dc0aec535..afdb984700e 100644 --- a/examples/widgets/dialogs/licensewizard/licensewizard.h +++ b/examples/widgets/dialogs/licensewizard/licensewizard.h @@ -78,7 +78,7 @@ class IntroPage : public QWizardPage public: IntroPage(QWidget *parent = 0); - int nextId() const; + int nextId() const Q_DECL_OVERRIDE; private: QLabel *topLabel; @@ -95,7 +95,7 @@ class EvaluatePage : public QWizardPage public: EvaluatePage(QWidget *parent = 0); - int nextId() const; + int nextId() const Q_DECL_OVERRIDE; private: QLabel *nameLabel; @@ -112,7 +112,7 @@ class RegisterPage : public QWizardPage public: RegisterPage(QWidget *parent = 0); - int nextId() const; + int nextId() const Q_DECL_OVERRIDE; private: QLabel *nameLabel; @@ -128,7 +128,7 @@ class DetailsPage : public QWizardPage public: DetailsPage(QWidget *parent = 0); - int nextId() const; + int nextId() const Q_DECL_OVERRIDE; private: QLabel *companyLabel; @@ -147,9 +147,9 @@ class ConclusionPage : public QWizardPage public: ConclusionPage(QWidget *parent = 0); - void initializePage(); - int nextId() const; - void setVisible(bool visible); + void initializePage() Q_DECL_OVERRIDE; + int nextId() const Q_DECL_OVERRIDE; + void setVisible(bool visible) Q_DECL_OVERRIDE; private slots: void printButtonClicked(); diff --git a/examples/widgets/draganddrop/draggableicons/dragwidget.h b/examples/widgets/draganddrop/draggableicons/dragwidget.h index e9d3bb88c7d..a1b570a8762 100644 --- a/examples/widgets/draganddrop/draggableicons/dragwidget.h +++ b/examples/widgets/draganddrop/draggableicons/dragwidget.h @@ -55,10 +55,10 @@ public: DragWidget(QWidget *parent = 0); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); - void mousePressEvent(QMouseEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.h b/examples/widgets/draganddrop/draggabletext/dragwidget.h index 4198e000914..a214ca0d667 100644 --- a/examples/widgets/draganddrop/draggabletext/dragwidget.h +++ b/examples/widgets/draganddrop/draggabletext/dragwidget.h @@ -54,9 +54,9 @@ public: DragWidget(QWidget *parent = 0); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dropEvent(QDropEvent *event); - void mousePressEvent(QMouseEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; }; #endif // DRAGWIDGET_H diff --git a/examples/widgets/draganddrop/dropsite/droparea.h b/examples/widgets/draganddrop/dropsite/droparea.h index 6b4b3c49aaa..6d4be00252c 100644 --- a/examples/widgets/draganddrop/dropsite/droparea.h +++ b/examples/widgets/draganddrop/dropsite/droparea.h @@ -64,10 +64,10 @@ signals: //! [DropArea header part2] protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); - void dropEvent(QDropEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; private: QLabel *label; diff --git a/examples/widgets/draganddrop/fridgemagnets/dragwidget.h b/examples/widgets/draganddrop/fridgemagnets/dragwidget.h index 6d231b73ffe..6c45e19da85 100644 --- a/examples/widgets/draganddrop/fridgemagnets/dragwidget.h +++ b/examples/widgets/draganddrop/fridgemagnets/dragwidget.h @@ -55,10 +55,10 @@ public: DragWidget(QWidget *parent = 0); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); - void mousePressEvent(QMouseEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/draganddrop/puzzle/pieceslist.h b/examples/widgets/draganddrop/puzzle/pieceslist.h index c032a673646..8baed434dbc 100644 --- a/examples/widgets/draganddrop/puzzle/pieceslist.h +++ b/examples/widgets/draganddrop/puzzle/pieceslist.h @@ -52,10 +52,10 @@ public: void addPiece(QPixmap pixmap, QPoint location); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); - void startDrag(Qt::DropActions supportedActions); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void startDrag(Qt::DropActions supportedActions) Q_DECL_OVERRIDE; int m_PieceSize; }; diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.h b/examples/widgets/draganddrop/puzzle/puzzlewidget.h index d437993b644..2793f2aa777 100644 --- a/examples/widgets/draganddrop/puzzle/puzzlewidget.h +++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.h @@ -67,12 +67,12 @@ signals: void puzzleCompleted(); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); - void mousePressEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: int findPiece(const QRect &pieceRect) const; diff --git a/examples/widgets/effects/blurpicker/blureffect.h b/examples/widgets/effects/blurpicker/blureffect.h index 97459ac7075..3c0399e24fc 100644 --- a/examples/widgets/effects/blurpicker/blureffect.h +++ b/examples/widgets/effects/blurpicker/blureffect.h @@ -53,7 +53,7 @@ public: QRectF boundingRect() const; - void draw(QPainter *painter); + void draw(QPainter *painter) Q_DECL_OVERRIDE; private: void adjustForItem(); diff --git a/examples/widgets/effects/blurpicker/blurpicker.h b/examples/widgets/effects/blurpicker/blurpicker.h index 4c3d463fa81..0d06f6c28f3 100644 --- a/examples/widgets/effects/blurpicker/blurpicker.h +++ b/examples/widgets/effects/blurpicker/blurpicker.h @@ -59,9 +59,9 @@ public: void setIndex(qreal); protected: - void keyPressEvent(QKeyEvent *event); - void resizeEvent(QResizeEvent *event); - void mousePressEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private: void setupScene(); diff --git a/examples/widgets/effects/lighting/lighting.h b/examples/widgets/effects/lighting/lighting.h index c33bb7ad165..29c6616c0cc 100644 --- a/examples/widgets/effects/lighting/lighting.h +++ b/examples/widgets/effects/lighting/lighting.h @@ -58,7 +58,7 @@ private: void setupScene(); protected: - void resizeEvent(QResizeEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private: qreal angle; diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h index d061935fe00..fc1faf9379c 100644 --- a/examples/widgets/gestures/imagegestures/imagewidget.h +++ b/examples/widgets/gestures/imagegestures/imagewidget.h @@ -65,10 +65,10 @@ public: void grabGestures(const QList<Qt::GestureType> &gestures); protected: - bool event(QEvent *event); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private: bool gestureEvent(QGestureEvent *event); diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h index 143aefe2117..7b12aa805bf 100644 --- a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h +++ b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h @@ -51,12 +51,12 @@ public: LayoutItem(QGraphicsItem *parent = 0); ~LayoutItem(); // Inherited from QGraphicsLayoutItem - void setGeometry(const QRectF &geom); - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; + void setGeometry(const QRectF &geom) Q_DECL_OVERRIDE; + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE; // Inherited from QGraphicsItem - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; private: QPixmap *m_pix; diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h index 304b3da87ac..6c6c80eed2c 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); diff --git a/examples/widgets/graphicsview/boxes/main.cpp b/examples/widgets/graphicsview/boxes/main.cpp index dcbf72e992e..d138a268d92 100644 --- a/examples/widgets/graphicsview/boxes/main.cpp +++ b/examples/widgets/graphicsview/boxes/main.cpp @@ -58,7 +58,7 @@ public: } protected: - void resizeEvent(QResizeEvent *event) { + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE { if (scene()) scene()->setSceneRect(QRect(QPoint(0, 0), event->size())); QGraphicsView::resizeEvent(event); diff --git a/examples/widgets/graphicsview/boxes/qtbox.h b/examples/widgets/graphicsview/boxes/qtbox.h index f71d66d3af2..7b6975d80ea 100644 --- a/examples/widgets/graphicsview/boxes/qtbox.h +++ b/examples/widgets/graphicsview/boxes/qtbox.h @@ -54,18 +54,18 @@ public: ItemBase(int size, int x, int y); virtual ~ItemBase(); - virtual QRectF boundingRect() const; - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual QRectF boundingRect() const Q_DECL_OVERRIDE; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: virtual ItemBase *createNew(int size, int x, int y) = 0; - virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event); - virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - virtual void keyPressEvent(QKeyEvent *event); - virtual void wheelEvent(QGraphicsSceneWheelEvent *event); - virtual int type() const; + virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE; + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; + virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + virtual void wheelEvent(QGraphicsSceneWheelEvent *event) Q_DECL_OVERRIDE; + virtual int type() const Q_DECL_OVERRIDE; bool isInResizeArea(const QPointF &pos); static void duplicateSelectedItems(QGraphicsScene *scene); @@ -83,9 +83,9 @@ class QtBox : public ItemBase public: QtBox(int size, int x, int y); virtual ~QtBox(); - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: - virtual ItemBase *createNew(int size, int x, int y); + virtual ItemBase *createNew(int size, int x, int y) Q_DECL_OVERRIDE; private: QVector3D m_vertices[8]; QVector3D m_texCoords[4]; @@ -97,9 +97,9 @@ class CircleItem : public ItemBase { public: CircleItem(int size, int x, int y); - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: - virtual ItemBase *createNew(int size, int x, int y); + virtual ItemBase *createNew(int size, int x, int y) Q_DECL_OVERRIDE; QColor m_color; }; @@ -108,9 +108,9 @@ class SquareItem : public ItemBase { public: SquareItem(int size, int x, int y); - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: - virtual ItemBase *createNew(int size, int x, int y); + virtual ItemBase *createNew(int size, int x, int y) Q_DECL_OVERRIDE; QPixmap m_image; }; diff --git a/examples/widgets/graphicsview/boxes/scene.h b/examples/widgets/graphicsview/boxes/scene.h index f3c36af5652..d20449b3dbd 100644 --- a/examples/widgets/graphicsview/boxes/scene.h +++ b/examples/widgets/graphicsview/boxes/scene.h @@ -72,13 +72,13 @@ class ColorEdit : public ParameterEdit public: ColorEdit(QRgb initialColor, int id); QRgb color() const {return m_color;} - virtual void emitChange() {emit colorChanged(m_color, m_id);} + virtual void emitChange() Q_DECL_OVERRIDE {emit colorChanged(m_color, m_id);} public slots: void editDone(); signals: void colorChanged(QRgb color, int id); protected: - virtual void mousePressEvent(QMouseEvent *event); + virtual void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void setColor(QRgb color); // also emits colorChanged() private: QGraphicsScene *m_dialogParentScene; @@ -94,7 +94,7 @@ class FloatEdit : public ParameterEdit public: FloatEdit(float initialValue, int id); float value() const {return m_value;} - virtual void emitChange() {emit valueChanged(m_value, m_id);} + virtual void emitChange() Q_DECL_OVERRIDE {emit valueChanged(m_value, m_id);} public slots: void editDone(); signals: @@ -111,9 +111,9 @@ class GraphicsWidget : public QGraphicsProxyWidget public: GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {} protected: - virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); - virtual void resizeEvent(QGraphicsSceneResizeEvent *event); - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE; + virtual void resizeEvent(QGraphicsSceneResizeEvent *event) Q_DECL_OVERRIDE; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; }; class TwoSidedGraphicsWidget : public QObject @@ -153,7 +153,7 @@ signals: void shaderChanged(int); void doubleClicked(); protected: - virtual void mouseDoubleClickEvent(QMouseEvent *event); + virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; QVector<QByteArray> m_parameterNames; QComboBox *m_textureCombo; @@ -180,7 +180,7 @@ signals: void doubleClicked(); void newItemTriggered(ItemDialog::ItemType type); protected: - virtual void mouseDoubleClickEvent(QMouseEvent *event); + virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; }; class Scene : public QGraphicsScene @@ -189,7 +189,7 @@ class Scene : public QGraphicsScene public: Scene(int width, int height, int maxTextureSize); ~Scene(); - virtual void drawBackground(QPainter *painter, const QRectF &rect); + virtual void drawBackground(QPainter *painter, const QRectF &rect) Q_DECL_OVERRIDE; public slots: void setShader(int index); @@ -205,10 +205,10 @@ protected: void defaultStates(); void renderCubemaps(); - virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - virtual void wheelEvent(QGraphicsSceneWheelEvent * event); + virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + virtual void wheelEvent(QGraphicsSceneWheelEvent * event) Q_DECL_OVERRIDE; private: void initGL(); QPointF pixelPosToViewPos(const QPointF& p); diff --git a/examples/widgets/graphicsview/chip/chip.h b/examples/widgets/graphicsview/chip/chip.h index f71ab13328f..98d8a9ce0a6 100644 --- a/examples/widgets/graphicsview/chip/chip.h +++ b/examples/widgets/graphicsview/chip/chip.h @@ -50,14 +50,14 @@ class Chip : public QGraphicsItem public: Chip(const QColor &color, int x, int y); - QRectF boundingRect() const; - QPainterPath shape() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget); + QRectF boundingRect() const Q_DECL_OVERRIDE; + QPainterPath shape() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) Q_DECL_OVERRIDE; protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; private: int x; diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h index 0abebaadadf..18f3460b2a6 100644 --- a/examples/widgets/graphicsview/chip/view.h +++ b/examples/widgets/graphicsview/chip/view.h @@ -61,7 +61,7 @@ public: protected: #ifndef QT_NO_WHEELEVENT - void wheelEvent(QWheelEvent *); + void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif private: diff --git a/examples/widgets/graphicsview/collidingmice/mouse.h b/examples/widgets/graphicsview/collidingmice/mouse.h index f2be900c6a8..a6c39e18018 100644 --- a/examples/widgets/graphicsview/collidingmice/mouse.h +++ b/examples/widgets/graphicsview/collidingmice/mouse.h @@ -49,13 +49,13 @@ class Mouse : public QGraphicsItem public: Mouse(); - QRectF boundingRect() const; - QPainterPath shape() const; + QRectF boundingRect() const Q_DECL_OVERRIDE; + QPainterPath shape() const Q_DECL_OVERRIDE; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget); + QWidget *widget) Q_DECL_OVERRIDE; protected: - void advance(int step); + void advance(int step) Q_DECL_OVERRIDE; private: qreal angle; diff --git a/examples/widgets/graphicsview/diagramscene/arrow.h b/examples/widgets/graphicsview/diagramscene/arrow.h index a8c81aee5ff..80a5d23635b 100644 --- a/examples/widgets/graphicsview/diagramscene/arrow.h +++ b/examples/widgets/graphicsview/diagramscene/arrow.h @@ -63,9 +63,9 @@ public: Arrow(DiagramItem *startItem, DiagramItem *endItem, QGraphicsItem *parent = 0); - int type() const { return Type; } - QRectF boundingRect() const; - QPainterPath shape() const; + int type() const Q_DECL_OVERRIDE { return Type; } + QRectF boundingRect() const Q_DECL_OVERRIDE; + QPainterPath shape() const Q_DECL_OVERRIDE; void setColor(const QColor &color) { myColor = color; } DiagramItem *startItem() const { return myStartItem; } DiagramItem *endItem() const { return myEndItem; } @@ -73,7 +73,7 @@ public: void updatePosition(); protected: - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; private: DiagramItem *myStartItem; diff --git a/examples/widgets/graphicsview/diagramscene/diagramitem.h b/examples/widgets/graphicsview/diagramscene/diagramitem.h index 6681d9b548b..af13f76e7eb 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramitem.h +++ b/examples/widgets/graphicsview/diagramscene/diagramitem.h @@ -75,11 +75,11 @@ public: QPolygonF polygon() const { return myPolygon; } void addArrow(Arrow *arrow); QPixmap image() const; - int type() const { return Type;} + int type() const Q_DECL_OVERRIDE { return Type;} protected: - void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); - QVariant itemChange(GraphicsItemChange change, const QVariant &value); + void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE; + QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE; private: DiagramType myDiagramType; diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.h b/examples/widgets/graphicsview/diagramscene/diagramscene.h index a28eba99e8f..17666e208ce 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramscene.h +++ b/examples/widgets/graphicsview/diagramscene/diagramscene.h @@ -85,9 +85,9 @@ signals: void itemSelected(QGraphicsItem *item); protected: - void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent); - void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent); + void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE; + void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) Q_DECL_OVERRIDE; private: bool isItemChange(int type); diff --git a/examples/widgets/graphicsview/diagramscene/diagramtextitem.h b/examples/widgets/graphicsview/diagramscene/diagramtextitem.h index 8041ccb53c1..6a6015fdeca 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramtextitem.h +++ b/examples/widgets/graphicsview/diagramscene/diagramtextitem.h @@ -61,16 +61,16 @@ public: DiagramTextItem(QGraphicsItem *parent = 0); - int type() const { return Type; } + int type() const Q_DECL_OVERRIDE { return Type; } signals: void lostFocus(DiagramTextItem *item); void selectedChange(QGraphicsItem *item); protected: - QVariant itemChange(GraphicsItemChange change, const QVariant &value); - void focusOutEvent(QFocusEvent *event); - void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE; + void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/graphicsview/dragdroprobot/coloritem.h b/examples/widgets/graphicsview/dragdroprobot/coloritem.h index 31ad3ddc07c..833f0836eaa 100644 --- a/examples/widgets/graphicsview/dragdroprobot/coloritem.h +++ b/examples/widgets/graphicsview/dragdroprobot/coloritem.h @@ -49,13 +49,13 @@ class ColorItem : public QGraphicsItem public: ColorItem(); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; private: QColor color; diff --git a/examples/widgets/graphicsview/dragdroprobot/main.cpp b/examples/widgets/graphicsview/dragdroprobot/main.cpp index ab7ad97d30d..34f190f0a55 100644 --- a/examples/widgets/graphicsview/dragdroprobot/main.cpp +++ b/examples/widgets/graphicsview/dragdroprobot/main.cpp @@ -53,7 +53,7 @@ public: } protected: - virtual void resizeEvent(QResizeEvent *) + virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE { } }; diff --git a/examples/widgets/graphicsview/dragdroprobot/robot.h b/examples/widgets/graphicsview/dragdroprobot/robot.h index a0c842e72c3..6ab60756ee8 100644 --- a/examples/widgets/graphicsview/dragdroprobot/robot.h +++ b/examples/widgets/graphicsview/dragdroprobot/robot.h @@ -55,9 +55,9 @@ public: RobotPart(QGraphicsItem *parent = 0); protected: - void dragEnterEvent(QGraphicsSceneDragDropEvent *event); - void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); - void dropEvent(QGraphicsSceneDragDropEvent *event); + void dragEnterEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE; + void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE; QColor color; bool dragOver; @@ -70,12 +70,12 @@ class RobotHead : public RobotPart public: RobotHead(QGraphicsItem *parent = 0); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; protected: - void dragEnterEvent(QGraphicsSceneDragDropEvent *event); - void dropEvent(QGraphicsSceneDragDropEvent *event); + void dragEnterEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE; private: QPixmap pixmap; @@ -88,8 +88,8 @@ class RobotTorso : public RobotPart public: RobotTorso(QGraphicsItem *parent = 0); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; }; //! [2] @@ -99,8 +99,8 @@ class RobotLimb : public RobotPart public: RobotLimb(QGraphicsItem *parent = 0); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; }; //! [3] @@ -110,8 +110,8 @@ class Robot : public RobotPart public: Robot(QGraphicsItem *parent = 0); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; }; //! [4] diff --git a/examples/widgets/graphicsview/elasticnodes/edge.h b/examples/widgets/graphicsview/elasticnodes/edge.h index 6ab71e34784..8a3cb7b19aa 100644 --- a/examples/widgets/graphicsview/elasticnodes/edge.h +++ b/examples/widgets/graphicsview/elasticnodes/edge.h @@ -57,11 +57,11 @@ public: void adjust(); enum { Type = UserType + 2 }; - int type() const { return Type; } + int type() const Q_DECL_OVERRIDE { return Type; } protected: - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; private: Node *source, *dest; diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.h b/examples/widgets/graphicsview/elasticnodes/graphwidget.h index 301a02dd25c..a7480945e3a 100644 --- a/examples/widgets/graphicsview/elasticnodes/graphwidget.h +++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.h @@ -61,12 +61,12 @@ public slots: void zoomOut(); protected: - void keyPressEvent(QKeyEvent *event); - void timerEvent(QTimerEvent *event); + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; #ifndef QT_NO_WHEELEVENT - void wheelEvent(QWheelEvent *event); + void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; #endif - void drawBackground(QPainter *painter, const QRectF &rect); + void drawBackground(QPainter *painter, const QRectF &rect) Q_DECL_OVERRIDE; void scaleView(qreal scaleFactor); diff --git a/examples/widgets/graphicsview/elasticnodes/node.h b/examples/widgets/graphicsview/elasticnodes/node.h index 813dbb1c547..2d18a646545 100644 --- a/examples/widgets/graphicsview/elasticnodes/node.h +++ b/examples/widgets/graphicsview/elasticnodes/node.h @@ -60,20 +60,20 @@ public: QList<Edge *> edges() const; enum { Type = UserType + 1 }; - int type() const { return Type; } + int type() const Q_DECL_OVERRIDE { return Type; } void calculateForces(); bool advance(); - QRectF boundingRect() const; - QPainterPath shape() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + QRectF boundingRect() const Q_DECL_OVERRIDE; + QPainterPath shape() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE; protected: - QVariant itemChange(GraphicsItemChange change, const QVariant &value); + QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE; - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; private: QList<Edge *> edgeList; diff --git a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h index 7257a90b12d..7708c165ad1 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h +++ b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h @@ -52,15 +52,15 @@ class CustomProxy : public QGraphicsProxyWidget public: explicit CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); - QRectF boundingRect() const; + QRectF boundingRect() const Q_DECL_OVERRIDE; void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget); + QWidget *widget) Q_DECL_OVERRIDE; protected: - void hoverEnterEvent(QGraphicsSceneHoverEvent *event); - void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); - bool sceneEventFilter(QGraphicsItem *watched, QEvent *event); - QVariant itemChange(GraphicsItemChange change, const QVariant &value); + void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; + void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE; + bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) Q_DECL_OVERRIDE; + QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE; private slots: void updateStep(qreal step); diff --git a/examples/widgets/graphicsview/flowlayout/flowlayout.h b/examples/widgets/graphicsview/flowlayout/flowlayout.h index f1419f6a24d..06ceca28852 100644 --- a/examples/widgets/graphicsview/flowlayout/flowlayout.h +++ b/examples/widgets/graphicsview/flowlayout/flowlayout.h @@ -50,14 +50,14 @@ public: qreal spacing(Qt::Orientation o) const; // inherited functions - void setGeometry(const QRectF &geom); + void setGeometry(const QRectF &geom) Q_DECL_OVERRIDE; - int count() const; - QGraphicsLayoutItem *itemAt(int index) const; - void removeAt(int index); + int count() const Q_DECL_OVERRIDE; + QGraphicsLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; + void removeAt(int index) Q_DECL_OVERRIDE; protected: - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE; private: qreal doLayout(const QRectF &geom, bool applyNewGeometry) const; diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.h b/examples/widgets/graphicsview/padnavigator/padnavigator.h index a666fe85d39..7e3e6fc29de 100644 --- a/examples/widgets/graphicsview/padnavigator/padnavigator.h +++ b/examples/widgets/graphicsview/padnavigator/padnavigator.h @@ -57,7 +57,7 @@ public: explicit PadNavigator(const QSize &size, QWidget *parent = 0); protected: - void resizeEvent(QResizeEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private: Ui::Form form; diff --git a/examples/widgets/graphicsview/padnavigator/roundrectitem.h b/examples/widgets/graphicsview/padnavigator/roundrectitem.h index 15c8847279d..f8eeafcfd65 100644 --- a/examples/widgets/graphicsview/padnavigator/roundrectitem.h +++ b/examples/widgets/graphicsview/padnavigator/roundrectitem.h @@ -56,8 +56,8 @@ public: QPixmap pixmap() const; void setPixmap(const QPixmap &pixmap); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; bool fill() const; void setFill(bool fill); diff --git a/examples/widgets/graphicsview/padnavigator/splashitem.h b/examples/widgets/graphicsview/padnavigator/splashitem.h index 2423a18c3d0..35646900d21 100644 --- a/examples/widgets/graphicsview/padnavigator/splashitem.h +++ b/examples/widgets/graphicsview/padnavigator/splashitem.h @@ -50,8 +50,8 @@ class SplashItem : public QGraphicsObject public: explicit SplashItem(QGraphicsItem *parent = 0); - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + QRectF boundingRect() const Q_DECL_OVERRIDE; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE; private: QString text; diff --git a/examples/widgets/graphicsview/simpleanchorlayout/main.cpp b/examples/widgets/graphicsview/simpleanchorlayout/main.cpp index c17c0252c3e..eed05f31890 100644 --- a/examples/widgets/graphicsview/simpleanchorlayout/main.cpp +++ b/examples/widgets/graphicsview/simpleanchorlayout/main.cpp @@ -52,7 +52,7 @@ public: { } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * = 0) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * = 0) Q_DECL_OVERRIDE { QFont font; font.setPixelSize(0.75 * qMin(boundingRect().width(), boundingRect().height())); diff --git a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp index 6f742756bee..c3db6275e1b 100644 --- a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp +++ b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp @@ -59,7 +59,7 @@ public: { } - virtual void resizeEvent(QResizeEvent *event) + virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE { w->setGeometry(0, 0, event->size().width(), event->size().height()); } @@ -91,7 +91,7 @@ public: original->setZValue(z); } - void setGeometry (const QRectF &rect) + void setGeometry (const QRectF &rect) Q_DECL_OVERRIDE { original->setTransform(QTransform::fromScale(rect.width() / r.width(), rect.height() / r.height()), true); @@ -100,7 +100,7 @@ public: } protected: - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE { Q_UNUSED(constraint); QSizeF sh; @@ -138,7 +138,7 @@ public: { } - void paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) + void paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) Q_DECL_OVERRIDE { QPointF reflection = QPointF(); reflection.setY(scaled.height() + 2); @@ -170,14 +170,14 @@ public: painter->drawPixmap(reflection, tmp); } - void resizeEvent(QGraphicsSceneResizeEvent *event) + void resizeEvent(QGraphicsSceneResizeEvent *event) Q_DECL_OVERRIDE { QSize newSize = event->newSize().toSize(); newSize.setHeight(newSize.height() / 2); scaled = original.scaled(newSize); } - QRectF boundingRect() const + QRectF boundingRect() const Q_DECL_OVERRIDE { QSize size(scaled.width(), scaled.height() * 2 + 2); return QRectF(QPointF(0, 0), size); diff --git a/examples/widgets/itemviews/addressbook/tablemodel.h b/examples/widgets/itemviews/addressbook/tablemodel.h index e282defa1b0..d505dbf6e70 100644 --- a/examples/widgets/itemviews/addressbook/tablemodel.h +++ b/examples/widgets/itemviews/addressbook/tablemodel.h @@ -54,14 +54,14 @@ public: TableModel(QObject *parent = 0); TableModel(QList<QPair<QString, QString> > listofPairs, QObject *parent = 0); - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()); - bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()); + int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE; + bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) Q_DECL_OVERRIDE; + bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) Q_DECL_OVERRIDE; QList<QPair<QString, QString> > getList(); private: diff --git a/examples/widgets/itemviews/chart/pieview.h b/examples/widgets/itemviews/chart/pieview.h index e8eb59758fe..7ad893c03af 100644 --- a/examples/widgets/itemviews/chart/pieview.h +++ b/examples/widgets/itemviews/chart/pieview.h @@ -51,44 +51,44 @@ class PieView : public QAbstractItemView public: PieView(QWidget *parent = 0); - QRect visualRect(const QModelIndex &index) const; - void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); - QModelIndex indexAt(const QPoint &point) const; + QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE; + void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE; + QModelIndex indexAt(const QPoint &point) const Q_DECL_OVERRIDE; protected slots: void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, - const QVector<int> &roles = QVector<int>()); - void rowsInserted(const QModelIndex &parent, int start, int end); - void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + const QVector<int> &roles = QVector<int>()) Q_DECL_OVERRIDE; + void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE; protected: - bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event); + bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) Q_DECL_OVERRIDE; QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, - Qt::KeyboardModifiers modifiers); + Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; - int horizontalOffset() const; - int verticalOffset() const; + int horizontalOffset() const Q_DECL_OVERRIDE; + int verticalOffset() const Q_DECL_OVERRIDE; - bool isIndexHidden(const QModelIndex &index) const; + bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE; - void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command); + void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); - void scrollContentsBy(int dx, int dy); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE; - QRegion visualRegionForSelection(const QItemSelection &selection) const; + QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE; private: QRect itemRect(const QModelIndex &item) const; QRegion itemRegion(const QModelIndex &index) const; int rows(const QModelIndex &index = QModelIndex()) const; - void updateGeometries(); + void updateGeometries() Q_DECL_OVERRIDE; int margin; int totalSize; diff --git a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h index c0c9aa3012f..b251a54c3d1 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h +++ b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.h @@ -59,8 +59,8 @@ public: void setFilterMaximumDate(const QDate &date); protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; - bool lessThan(const QModelIndex &left, const QModelIndex &right) const; + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE; + bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; private: bool dateInRange(const QDate &date) const; diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.h b/examples/widgets/itemviews/editabletreemodel/treemodel.h index 078e5e40776..0d0a9178d6d 100644 --- a/examples/widgets/itemviews/editabletreemodel/treemodel.h +++ b/examples/widgets/itemviews/editabletreemodel/treemodel.h @@ -58,33 +58,33 @@ public: ~TreeModel(); //! [0] //! [1] - QVariant data(const QModelIndex &index, int role) const; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; + const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; //! [1] //! [2] - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; bool setData(const QModelIndex &index, const QVariant &value, - int role = Qt::EditRole); + int role = Qt::EditRole) Q_DECL_OVERRIDE; bool setHeaderData(int section, Qt::Orientation orientation, - const QVariant &value, int role = Qt::EditRole); + const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE; bool insertColumns(int position, int columns, - const QModelIndex &parent = QModelIndex()); + const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; bool removeColumns(int position, int columns, - const QModelIndex &parent = QModelIndex()); + const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; bool insertRows(int position, int rows, - const QModelIndex &parent = QModelIndex()); + const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; bool removeRows(int position, int rows, - const QModelIndex &parent = QModelIndex()); + const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; private: void setupModelData(const QStringList &lines, TreeItem *parent); diff --git a/examples/widgets/itemviews/fetchmore/filelistmodel.h b/examples/widgets/itemviews/fetchmore/filelistmodel.h index 5daef80a83e..99c14904957 100644 --- a/examples/widgets/itemviews/fetchmore/filelistmodel.h +++ b/examples/widgets/itemviews/fetchmore/filelistmodel.h @@ -53,8 +53,8 @@ class FileListModel : public QAbstractListModel public: FileListModel(QObject *parent = 0); - int rowCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; signals: void numberPopulated(int number); @@ -63,8 +63,8 @@ public slots: void setDirPath(const QString &path); protected: - bool canFetchMore(const QModelIndex &parent) const; - void fetchMore(const QModelIndex &parent); + bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE; + void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE; private: QStringList fileList; diff --git a/examples/widgets/itemviews/frozencolumn/freezetablewidget.h b/examples/widgets/itemviews/frozencolumn/freezetablewidget.h index 53805316aac..ea3b0d4b6fc 100644 --- a/examples/widgets/itemviews/frozencolumn/freezetablewidget.h +++ b/examples/widgets/itemviews/frozencolumn/freezetablewidget.h @@ -53,9 +53,9 @@ public: protected: - virtual void resizeEvent(QResizeEvent *event); - virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers); - void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible); + virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE; + void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE; private: QTableView *frozenTableView; diff --git a/examples/widgets/itemviews/interview/model.h b/examples/widgets/itemviews/interview/model.h index 02c267f69a8..0dd722b855b 100644 --- a/examples/widgets/itemviews/interview/model.h +++ b/examples/widgets/itemviews/interview/model.h @@ -55,17 +55,17 @@ public: Model(int rows, int columns, QObject *parent = 0); ~Model(); - QModelIndex index(int row, int column, const QModelIndex &parent) const; - QModelIndex parent(const QModelIndex &child) const; + QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; + int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; - bool hasChildren(const QModelIndex &parent) const; - Qt::ItemFlags flags(const QModelIndex &index) const; + bool hasChildren(const QModelIndex &parent) const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; private: diff --git a/examples/widgets/itemviews/pixelator/imagemodel.h b/examples/widgets/itemviews/pixelator/imagemodel.h index 3cb5d32b205..49c3b3269d1 100644 --- a/examples/widgets/itemviews/pixelator/imagemodel.h +++ b/examples/widgets/itemviews/pixelator/imagemodel.h @@ -54,11 +54,11 @@ public: void setImage(const QImage &image); - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; private: QImage modelImage; diff --git a/examples/widgets/itemviews/pixelator/pixeldelegate.h b/examples/widgets/itemviews/pixelator/pixeldelegate.h index b4426ea2686..c7d27ba52d2 100644 --- a/examples/widgets/itemviews/pixelator/pixeldelegate.h +++ b/examples/widgets/itemviews/pixelator/pixeldelegate.h @@ -62,10 +62,10 @@ public: PixelDelegate(QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index ) const; + const QModelIndex &index ) const Q_DECL_OVERRIDE; public slots: void setPixelSize(int size); diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.h b/examples/widgets/itemviews/puzzle/piecesmodel.h index 72df1cef92e..a6e31f21079 100644 --- a/examples/widgets/itemviews/puzzle/piecesmodel.h +++ b/examples/widgets/itemviews/puzzle/piecesmodel.h @@ -58,16 +58,16 @@ class PiecesModel : public QAbstractListModel public: explicit PiecesModel(int pieceSize, QObject *parent = 0); - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - bool removeRows(int row, int count, const QModelIndex &parent); + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + bool removeRows(int row, int count, const QModelIndex &parent) Q_DECL_OVERRIDE; bool dropMimeData(const QMimeData *data, Qt::DropAction action, - int row, int column, const QModelIndex &parent); - QMimeData *mimeData(const QModelIndexList &indexes) const; - QStringList mimeTypes() const; - int rowCount(const QModelIndex &parent) const; - Qt::DropActions supportedDropActions() const; + int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE; + QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE; + QStringList mimeTypes() const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE; + Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE; void addPiece(const QPixmap &pixmap, const QPoint &location); void addPieces(const QPixmap& pixmap); diff --git a/examples/widgets/itemviews/puzzle/puzzlewidget.h b/examples/widgets/itemviews/puzzle/puzzlewidget.h index 5da81b9c63f..41dc141ee47 100644 --- a/examples/widgets/itemviews/puzzle/puzzlewidget.h +++ b/examples/widgets/itemviews/puzzle/puzzlewidget.h @@ -67,12 +67,12 @@ signals: void puzzleCompleted(); protected: - void dragEnterEvent(QDragEnterEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); - void mousePressEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); + void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; + void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: int findPiece(const QRect &pieceRect) const; diff --git a/examples/widgets/itemviews/simpledommodel/dommodel.h b/examples/widgets/itemviews/simpledommodel/dommodel.h index 7e56707198f..27ece11b452 100644 --- a/examples/widgets/itemviews/simpledommodel/dommodel.h +++ b/examples/widgets/itemviews/simpledommodel/dommodel.h @@ -56,15 +56,15 @@ public: explicit DomModel(QDomDocument document, QObject *parent = 0); ~DomModel(); - QVariant data(const QModelIndex &index, int role) const; - Qt::ItemFlags flags(const QModelIndex &index) const; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; private: QDomDocument domDocument; diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.h b/examples/widgets/itemviews/simpletreemodel/treemodel.h index 3bd593bc3e0..964f0077c1e 100644 --- a/examples/widgets/itemviews/simpletreemodel/treemodel.h +++ b/examples/widgets/itemviews/simpletreemodel/treemodel.h @@ -56,15 +56,15 @@ public: explicit TreeModel(const QString &data, QObject *parent = 0); ~TreeModel(); - QVariant data(const QModelIndex &index, int role) const; - Qt::ItemFlags flags(const QModelIndex &index) const; + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; private: void setupModelData(const QStringList &lines, TreeItem *parent); diff --git a/examples/widgets/itemviews/spinboxdelegate/delegate.h b/examples/widgets/itemviews/spinboxdelegate/delegate.h index 454471e155e..9f5eb2b28b8 100644 --- a/examples/widgets/itemviews/spinboxdelegate/delegate.h +++ b/examples/widgets/itemviews/spinboxdelegate/delegate.h @@ -52,14 +52,14 @@ public: SpinBoxDelegate(QObject *parent = 0); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; - void setEditorData(QWidget *editor, const QModelIndex &index) const; + void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; void updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, const QModelIndex &index) const; + const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h index 464c2c3170c..b67a2b690a6 100644 --- a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h +++ b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.h @@ -53,10 +53,10 @@ class SpreadSheetDelegate : public QItemDelegate public: SpreadSheetDelegate(QObject *parent = 0); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, - const QModelIndex &index) const; - void setEditorData(QWidget *editor, const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; + void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; private slots: void commitAndCloseEditor(); diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h index 4f1c1e1e4ce..5af1fd1656f 100644 --- a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h +++ b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.h @@ -52,10 +52,10 @@ public: SpreadSheetItem(); SpreadSheetItem(const QString &text); - QTableWidgetItem *clone() const; + QTableWidgetItem *clone() const Q_DECL_OVERRIDE; - QVariant data(int role) const; - void setData(int role, const QVariant &value); + QVariant data(int role) const Q_DECL_OVERRIDE; + void setData(int role, const QVariant &value) Q_DECL_OVERRIDE; QVariant display() const; inline QString formula() const diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.h b/examples/widgets/itemviews/stardelegate/stardelegate.h index 334dfbf375e..03cd5d7e9b8 100644 --- a/examples/widgets/itemviews/stardelegate/stardelegate.h +++ b/examples/widgets/itemviews/stardelegate/stardelegate.h @@ -52,14 +52,14 @@ public: StarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {} void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - void setEditorData(QWidget *editor, const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; + void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; private slots: void commitAndCloseEditor(); diff --git a/examples/widgets/itemviews/stardelegate/stareditor.h b/examples/widgets/itemviews/stardelegate/stareditor.h index a9a635b55b0..c917d12b49e 100644 --- a/examples/widgets/itemviews/stardelegate/stareditor.h +++ b/examples/widgets/itemviews/stardelegate/stareditor.h @@ -53,7 +53,7 @@ class StarEditor : public QWidget public: StarEditor(QWidget *parent = 0); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; void setStarRating(const StarRating &starRating) { myStarRating = starRating; } @@ -63,9 +63,9 @@ signals: void editingFinished(); protected: - void paintEvent(QPaintEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private: int starAtPosition(int x); diff --git a/examples/widgets/layouts/borderlayout/borderlayout.h b/examples/widgets/layouts/borderlayout/borderlayout.h index eae425d5e63..3a6031a9974 100644 --- a/examples/widgets/layouts/borderlayout/borderlayout.h +++ b/examples/widgets/layouts/borderlayout/borderlayout.h @@ -53,16 +53,16 @@ public: BorderLayout(int spacing = -1); ~BorderLayout(); - void addItem(QLayoutItem *item); + void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; void addWidget(QWidget *widget, Position position); - Qt::Orientations expandingDirections() const; - bool hasHeightForWidth() const; - int count() const; - QLayoutItem *itemAt(int index) const; - QSize minimumSize() const; - void setGeometry(const QRect &rect); - QSize sizeHint() const; - QLayoutItem *takeAt(int index); + Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; + bool hasHeightForWidth() const Q_DECL_OVERRIDE; + int count() const Q_DECL_OVERRIDE; + QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; + QSize minimumSize() const Q_DECL_OVERRIDE; + void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; + QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; void add(QLayoutItem *item, Position position); diff --git a/examples/widgets/layouts/flowlayout/flowlayout.h b/examples/widgets/layouts/flowlayout/flowlayout.h index f7107be6b26..6c4b9e5ec5f 100644 --- a/examples/widgets/layouts/flowlayout/flowlayout.h +++ b/examples/widgets/layouts/flowlayout/flowlayout.h @@ -52,18 +52,18 @@ public: explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1); ~FlowLayout(); - void addItem(QLayoutItem *item); + void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; int horizontalSpacing() const; int verticalSpacing() const; - Qt::Orientations expandingDirections() const; - bool hasHeightForWidth() const; - int heightForWidth(int) const; - int count() const; - QLayoutItem *itemAt(int index) const; - QSize minimumSize() const; - void setGeometry(const QRect &rect); - QSize sizeHint() const; - QLayoutItem *takeAt(int index); + Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; + bool hasHeightForWidth() const Q_DECL_OVERRIDE; + int heightForWidth(int) const Q_DECL_OVERRIDE; + int count() const Q_DECL_OVERRIDE; + QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; + QSize minimumSize() const Q_DECL_OVERRIDE; + void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; + QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; private: int doLayout(const QRect &rect, bool testOnly) const; diff --git a/examples/widgets/mainwindows/application/mainwindow.h b/examples/widgets/mainwindows/application/mainwindow.h index b4d5c10755d..828db44dc6b 100644 --- a/examples/widgets/mainwindows/application/mainwindow.h +++ b/examples/widgets/mainwindows/application/mainwindow.h @@ -58,7 +58,7 @@ public: MainWindow(); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void newFile(); diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp index b39c45118c5..e481a714097 100644 --- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp +++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp @@ -101,8 +101,8 @@ class ColorDock : public QFrame public: ColorDock(const QString &c, QWidget *parent); - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + virtual QSize sizeHint() const Q_DECL_OVERRIDE; + virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE; void setCustomSizeHint(const QSize &size); @@ -110,7 +110,7 @@ public slots: void changeSizeHints(); protected: - void paintEvent(QPaintEvent *); + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; QString color; QSize szHint, minSzHint; }; diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h index b83a6ba76a5..73f3fbdaa68 100644 --- a/examples/widgets/mainwindows/mainwindow/colorswatch.h +++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h @@ -85,8 +85,8 @@ public: void setCustomSizeHint(const QSize &size); protected: - virtual void contextMenuEvent(QContextMenuEvent *event); - virtual void resizeEvent(QResizeEvent *e); + virtual void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE; + virtual void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; private: void allow(Qt::DockWidgetArea area, bool allow); @@ -120,11 +120,11 @@ class BlueTitleBar : public QWidget public: BlueTitleBar(QWidget *parent = 0); - QSize sizeHint() const { return minimumSizeHint(); } - QSize minimumSizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSizeHint(); } + QSize minimumSizeHint() const Q_DECL_OVERRIDE; protected: - void paintEvent(QPaintEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; public slots: void updateMask(); diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.h b/examples/widgets/mainwindows/mainwindow/mainwindow.h index 4f8b65ab3af..d61cd4e2673 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.h +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.h @@ -67,7 +67,7 @@ public: QWidget *parent = 0, Qt::WindowFlags flags = 0); protected: - void showEvent(QShowEvent *event); + void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; public slots: void actionTriggered(QAction *action); diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.h b/examples/widgets/mainwindows/mainwindow/toolbar.h index 1060e32ce1a..b773227eac3 100644 --- a/examples/widgets/mainwindows/mainwindow/toolbar.h +++ b/examples/widgets/mainwindows/mainwindow/toolbar.h @@ -84,8 +84,8 @@ public: QMenu *menu; protected: - void enterEvent(QEvent*); - void leaveEvent(QEvent*); + void enterEvent(QEvent*) Q_DECL_OVERRIDE; + void leaveEvent(QEvent*) Q_DECL_OVERRIDE; private: void allow(Qt::ToolBarArea area, bool allow); diff --git a/examples/widgets/mainwindows/mdi/mainwindow.h b/examples/widgets/mainwindows/mdi/mainwindow.h index c2d50728b81..b24cdd4db18 100644 --- a/examples/widgets/mainwindows/mdi/mainwindow.h +++ b/examples/widgets/mainwindows/mdi/mainwindow.h @@ -60,7 +60,7 @@ public: MainWindow(); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void newFile(); diff --git a/examples/widgets/mainwindows/mdi/mdichild.h b/examples/widgets/mainwindows/mdi/mdichild.h index 8fa08f7bf29..fe5fb394786 100644 --- a/examples/widgets/mainwindows/mdi/mdichild.h +++ b/examples/widgets/mainwindows/mdi/mdichild.h @@ -59,7 +59,7 @@ public: QString currentFile() { return curFile; } protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void documentWasModified(); diff --git a/examples/widgets/mainwindows/menus/mainwindow.h b/examples/widgets/mainwindows/menus/mainwindow.h index fc61ed66b63..0130007b651 100644 --- a/examples/widgets/mainwindows/menus/mainwindow.h +++ b/examples/widgets/mainwindows/menus/mainwindow.h @@ -59,7 +59,7 @@ public: MainWindow(); protected: - void contextMenuEvent(QContextMenuEvent *event); + void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE; //! [0] //! [1] diff --git a/examples/widgets/mainwindows/sdi/mainwindow.h b/examples/widgets/mainwindows/sdi/mainwindow.h index 51a2de4a419..dc8498a2475 100644 --- a/examples/widgets/mainwindows/sdi/mainwindow.h +++ b/examples/widgets/mainwindows/sdi/mainwindow.h @@ -60,7 +60,7 @@ public: MainWindow(const QString &fileName); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void newFile(); diff --git a/examples/widgets/painting/affine/xform.h b/examples/widgets/painting/affine/xform.h index 67ebf436894..46038b29fdf 100644 --- a/examples/widgets/painting/affine/xform.h +++ b/examples/widgets/painting/affine/xform.h @@ -71,14 +71,14 @@ public: enum XFormType { VectorType, PixmapType, TextType }; XFormView(QWidget *parent); - void paint(QPainter *); + void paint(QPainter *) Q_DECL_OVERRIDE; void drawVectorType(QPainter *painter); void drawPixmapType(QPainter *painter); void drawTextType(QPainter *painter); - QSize sizeHint() const { return QSize(500, 500); } + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 500); } - void mousePressEvent(QMouseEvent *e); - void resizeEvent(QResizeEvent *e); + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; HoverPoints *hoverPoints() { return pts; } bool animation() const { return timer.isActive(); } @@ -115,9 +115,9 @@ signals: void shearChanged(int shear); protected: - void timerEvent(QTimerEvent *e); + void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; #ifndef QT_NO_WHEELEVENT - void wheelEvent(QWheelEvent *); + void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; #endif private: diff --git a/examples/widgets/painting/basicdrawing/renderarea.h b/examples/widgets/painting/basicdrawing/renderarea.h index 3975ddbbe37..e39db21d32b 100644 --- a/examples/widgets/painting/basicdrawing/renderarea.h +++ b/examples/widgets/painting/basicdrawing/renderarea.h @@ -57,8 +57,8 @@ public: RenderArea(QWidget *parent = 0); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; public slots: void setShape(Shape shape); @@ -68,7 +68,7 @@ public slots: void setTransformed(bool transformed); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: Shape shape; diff --git a/examples/widgets/painting/composition/composition.h b/examples/widgets/painting/composition/composition.h index b52cc516812..610017a5d8f 100644 --- a/examples/widgets/painting/composition/composition.h +++ b/examples/widgets/painting/composition/composition.h @@ -109,21 +109,21 @@ class CompositionRenderer : public ArthurFrame public: CompositionRenderer(QWidget *parent); - void paint(QPainter *); + void paint(QPainter *) Q_DECL_OVERRIDE; void setCirclePos(const QPointF &pos); - QSize sizeHint() const { return QSize(500, 400); } + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 400); } bool animationEnabled() const { return m_animation_enabled; } int circleColor() const { return m_circle_hue; } int circleAlpha() const { return m_circle_alpha; } protected: - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void timerEvent(QTimerEvent *); + void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; public slots: void setClearMode() { m_composition_mode = QPainter::CompositionMode_Clear; update(); } diff --git a/examples/widgets/painting/concentriccircles/circlewidget.h b/examples/widgets/painting/concentriccircles/circlewidget.h index a1ca3dfe43e..f09ab10a485 100644 --- a/examples/widgets/painting/concentriccircles/circlewidget.h +++ b/examples/widgets/painting/concentriccircles/circlewidget.h @@ -54,14 +54,14 @@ public: void setFloatBased(bool floatBased); void setAntialiased(bool antialiased); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; public slots: void nextAnimationFrame(); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: bool floatBased; diff --git a/examples/widgets/painting/deform/pathdeform.h b/examples/widgets/painting/deform/pathdeform.h index c5c86d10176..f89c5a2c862 100644 --- a/examples/widgets/painting/deform/pathdeform.h +++ b/examples/widgets/painting/deform/pathdeform.h @@ -60,14 +60,14 @@ class PathDeformRenderer : public ArthurFrame public: explicit PathDeformRenderer(QWidget *widget, bool smallScreen = false); - void paint(QPainter *painter); + void paint(QPainter *painter) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void timerEvent(QTimerEvent *e); + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; - QSize sizeHint() const { return QSize(600, 500); } + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(600, 500); } bool animated() const { return m_animated; } int radius() const { return int(m_radius); } diff --git a/examples/widgets/painting/gradients/gradients.h b/examples/widgets/painting/gradients/gradients.h index ee719bb3c2f..7d9aa9c1e6f 100644 --- a/examples/widgets/painting/gradients/gradients.h +++ b/examples/widgets/painting/gradients/gradients.h @@ -67,9 +67,9 @@ public: void setGradientStops(const QGradientStops &stops); - void paintEvent(QPaintEvent *e); + void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; - QSize sizeHint() const { return QSize(150, 40); } + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(150, 40); } QPolygonF points() const; HoverPoints *hoverPoints() const { return m_hoverPoints; } @@ -116,12 +116,12 @@ class GradientRenderer : public ArthurFrame public: GradientRenderer(QWidget *parent); - void paint(QPainter *p); + void paint(QPainter *p) Q_DECL_OVERRIDE; - QSize sizeHint() const { return QSize(400, 400); } + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(400, 400); } HoverPoints *hoverPoints() const { return m_hoverPoints; } - void mousePressEvent(QMouseEvent *e); + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; public slots: void setGradientStops(const QGradientStops &stops); diff --git a/examples/widgets/painting/painterpaths/renderarea.h b/examples/widgets/painting/painterpaths/renderarea.h index 02d0adb1ecf..be5de5952d0 100644 --- a/examples/widgets/painting/painterpaths/renderarea.h +++ b/examples/widgets/painting/painterpaths/renderarea.h @@ -52,8 +52,8 @@ class RenderArea : public QWidget public: explicit RenderArea(const QPainterPath &path, QWidget *parent = 0); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; public slots: void setFillRule(Qt::FillRule rule); @@ -63,7 +63,7 @@ public slots: void setRotationAngle(int degrees); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; //! [0] //! [1] diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h index a6971014484..d801b05b081 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.h +++ b/examples/widgets/painting/pathstroke/pathstroke.h @@ -56,14 +56,14 @@ public: explicit PathStrokeRenderer(QWidget *parent, bool smallScreen = false); - void paint(QPainter *); - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void timerEvent(QTimerEvent *e); - bool event(QEvent *e); - - QSize sizeHint() const { return QSize(500, 500); } + void paint(QPainter *) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) Q_DECL_OVERRIDE; + + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 500); } bool animation() const { return m_timer.isActive(); } diff --git a/examples/widgets/painting/shared/arthurstyle.h b/examples/widgets/painting/shared/arthurstyle.h index ede7fe860bb..8b78aa14de4 100644 --- a/examples/widgets/painting/shared/arthurstyle.h +++ b/examples/widgets/painting/shared/arthurstyle.h @@ -54,23 +54,23 @@ public: void drawHoverRect(QPainter *painter, const QRect &rect) const; void drawPrimitive(PrimitiveElement element, const QStyleOption *option, - QPainter *painter, const QWidget *widget = 0) const; + QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE; void drawControl(ControlElement element, const QStyleOption *option, - QPainter *painter, const QWidget *widget) const; + QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, - QPainter *painter, const QWidget *widget) const; + QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; QSize sizeFromContents(ContentsType type, const QStyleOption *option, - const QSize &size, const QWidget *widget) const; + const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE; - QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const; + QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE; QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, - SubControl sc, const QWidget *widget) const; + SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE; - int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const; + int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE; - void polish(QPalette &palette); - void polish(QWidget *widget); - void unpolish(QWidget *widget); + void polish(QPalette &palette) Q_DECL_OVERRIDE; + void polish(QWidget *widget) Q_DECL_OVERRIDE; + void unpolish(QWidget *widget) Q_DECL_OVERRIDE; }; #endif diff --git a/examples/widgets/painting/shared/arthurwidgets.h b/examples/widgets/painting/shared/arthurwidgets.h index 2d96ed63d4d..02d0a566565 100644 --- a/examples/widgets/painting/shared/arthurwidgets.h +++ b/examples/widgets/painting/shared/arthurwidgets.h @@ -59,9 +59,9 @@ public: setAttribute(Qt::WA_AcceptTouchEvents); } void disableAutoBufferSwap() { setAutoBufferSwap(false); } - void paintEvent(QPaintEvent *) { parentWidget()->update(); } + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE { parentWidget()->update(); } protected: - bool event(QEvent *event) + bool event(QEvent *event) Q_DECL_OVERRIDE { switch (event->type()) { case QEvent::TouchBegin: @@ -117,8 +117,8 @@ signals: void descriptionEnabledChanged(bool); protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; #if defined(QT_OPENGL_SUPPORT) GLWidget *glw; diff --git a/examples/widgets/painting/shared/hoverpoints.h b/examples/widgets/painting/shared/hoverpoints.h index adc920de30f..7fa28c79ed9 100644 --- a/examples/widgets/painting/shared/hoverpoints.h +++ b/examples/widgets/painting/shared/hoverpoints.h @@ -76,7 +76,7 @@ public: HoverPoints(QWidget *widget, PointShape shape); - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; void paintPoints(); diff --git a/examples/widgets/painting/transformations/renderarea.h b/examples/widgets/painting/transformations/renderarea.h index 214c3803d0c..fb814d580c8 100644 --- a/examples/widgets/painting/transformations/renderarea.h +++ b/examples/widgets/painting/transformations/renderarea.h @@ -65,11 +65,11 @@ public: void setOperations(const QList<Operation> &operations); void setShape(const QPainterPath &shape); - QSize minimumSizeHint() const; - QSize sizeHint() const; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; + QSize sizeHint() const Q_DECL_OVERRIDE; protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; //! [1] //! [2] diff --git a/examples/widgets/richtext/syntaxhighlighter/highlighter.h b/examples/widgets/richtext/syntaxhighlighter/highlighter.h index 3e6e9022c96..88fa469cb50 100644 --- a/examples/widgets/richtext/syntaxhighlighter/highlighter.h +++ b/examples/widgets/richtext/syntaxhighlighter/highlighter.h @@ -57,7 +57,7 @@ public: Highlighter(QTextDocument *parent = 0); protected: - void highlightBlock(const QString &text); + void highlightBlock(const QString &text) Q_DECL_OVERRIDE; private: struct HighlightingRule diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h index a19a13e6849..a61240599fd 100644 --- a/examples/widgets/richtext/textedit/textedit.h +++ b/examples/widgets/richtext/textedit/textedit.h @@ -64,7 +64,7 @@ public: TextEdit(QWidget *parent = 0); protected: - virtual void closeEvent(QCloseEvent *e); + virtual void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE; private: void setupFileActions(); diff --git a/examples/widgets/scroller/graphicsview/main.cpp b/examples/widgets/scroller/graphicsview/main.cpp index c17529d7c82..ef81315ca7f 100644 --- a/examples/widgets/scroller/graphicsview/main.cpp +++ b/examples/widgets/scroller/graphicsview/main.cpp @@ -64,7 +64,7 @@ public: setFlag(QGraphicsItem::ItemClipsToShape, true); } - QRectF boundingRect() const + QRectF boundingRect() const Q_DECL_OVERRIDE { // here we only want the size of the children and not the size of the children of the children... qreal halfpw = m_pen.widthF() / 2; @@ -75,7 +75,7 @@ public: return rect; } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE { Q_UNUSED(option); Q_UNUSED(widget); @@ -104,7 +104,7 @@ public: : QGraphicsObject(parent) { } - QRectF boundingRect() const + QRectF boundingRect() const Q_DECL_OVERRIDE { QRectF rect; foreach (QGraphicsItem *item, childItems()) @@ -112,7 +112,7 @@ public: return rect; } - void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) + void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) Q_DECL_OVERRIDE { } }; @@ -140,7 +140,7 @@ public: return m_viewport; } - bool event(QEvent *e) + bool event(QEvent *e) Q_DECL_OVERRIDE { switch (e->type()) { // ![2] @@ -169,7 +169,7 @@ public: return QGraphicsObject::event(e); } - bool sceneEvent(QEvent *e) + bool sceneEvent(QEvent *e) Q_DECL_OVERRIDE { switch (e->type()) { case QEvent::TouchBegin: { @@ -194,12 +194,12 @@ public: return QGraphicsObject::sceneEvent(e); } - QRectF boundingRect() const + QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(0, 0, m_size.width() + 3, m_size.height()); } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE { Q_UNUSED(option); Q_UNUSED(widget); @@ -265,7 +265,7 @@ public: protected: - void resizeEvent(QResizeEvent *e) + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE { // resize the scene according to our own size to prevent scrolling m_scene->setSceneRect(0, 0, m_view->viewport()->width(), m_view->viewport()->height()); diff --git a/examples/widgets/statemachine/factorial/main.cpp b/examples/widgets/statemachine/factorial/main.cpp index 1ad2740563e..5e83e27b080 100644 --- a/examples/widgets/statemachine/factorial/main.cpp +++ b/examples/widgets/statemachine/factorial/main.cpp @@ -93,7 +93,7 @@ public: : QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact) {} - virtual bool eventTest(QEvent *e) + virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE { if (!QSignalTransition::eventTest(e)) return false; @@ -101,7 +101,7 @@ public: return se->arguments().at(0).toInt() > 1; } - virtual void onTransition(QEvent *e) + virtual void onTransition(QEvent *e) Q_DECL_OVERRIDE { QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e); int x = se->arguments().at(0).toInt(); @@ -123,7 +123,7 @@ public: : QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact) {} - virtual bool eventTest(QEvent *e) + virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE { if (!QSignalTransition::eventTest(e)) return false; @@ -131,7 +131,7 @@ public: return se->arguments().at(0).toInt() <= 1; } - virtual void onTransition(QEvent *) + virtual void onTransition(QEvent *) Q_DECL_OVERRIDE { fprintf(stdout, "%d\n", m_fact->property("fac").toInt()); } diff --git a/examples/widgets/statemachine/pingpong/main.cpp b/examples/widgets/statemachine/pingpong/main.cpp index 869728f993e..acb125d54b0 100644 --- a/examples/widgets/statemachine/pingpong/main.cpp +++ b/examples/widgets/statemachine/pingpong/main.cpp @@ -65,7 +65,7 @@ public: : QState(parent) {} protected: - virtual void onEntry(QEvent *) + virtual void onEntry(QEvent *) Q_DECL_OVERRIDE { machine()->postEvent(new PingEvent()); fprintf(stdout, "ping?\n"); @@ -80,10 +80,10 @@ public: PongTransition() {} protected: - virtual bool eventTest(QEvent *e) { + virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE { return (e->type() == QEvent::User+3); } - virtual void onTransition(QEvent *) + virtual void onTransition(QEvent *) Q_DECL_OVERRIDE { machine()->postDelayedEvent(new PingEvent(), 500); fprintf(stdout, "ping?\n"); @@ -98,10 +98,10 @@ public: PingTransition() {} protected: - virtual bool eventTest(QEvent *e) { + virtual bool eventTest(QEvent *e) Q_DECL_OVERRIDE { return (e->type() == QEvent::User+2); } - virtual void onTransition(QEvent *) + virtual void onTransition(QEvent *) Q_DECL_OVERRIDE { machine()->postDelayedEvent(new PongEvent(), 500); fprintf(stdout, "pong!\n"); diff --git a/examples/widgets/statemachine/rogue/movementtransition.h b/examples/widgets/statemachine/rogue/movementtransition.h index 23359f78866..5cfa868b227 100644 --- a/examples/widgets/statemachine/rogue/movementtransition.h +++ b/examples/widgets/statemachine/rogue/movementtransition.h @@ -59,7 +59,7 @@ public: //![1] protected: - bool eventTest(QEvent *event) { + bool eventTest(QEvent *event) Q_DECL_OVERRIDE { if (event->type() == QEvent::StateMachineWrapped && static_cast<QStateMachine::WrappedEvent *>(event)->event()->type() == QEvent::KeyPress) { QEvent *wrappedEvent = static_cast<QStateMachine::WrappedEvent *>(event)->event(); @@ -76,7 +76,7 @@ protected: //![1] //![2] - void onTransition(QEvent *event) { + void onTransition(QEvent *event) Q_DECL_OVERRIDE { QKeyEvent *keyEvent = static_cast<QKeyEvent *>( static_cast<QStateMachine::WrappedEvent *>(event)->event()); diff --git a/examples/widgets/statemachine/rogue/window.h b/examples/widgets/statemachine/rogue/window.h index 71f195cba1e..482c8cf1110 100644 --- a/examples/widgets/statemachine/rogue/window.h +++ b/examples/widgets/statemachine/rogue/window.h @@ -67,10 +67,10 @@ public: void setStatus(const QString &status); QString status() const; - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; //![0] //![1] diff --git a/examples/widgets/statemachine/trafficlight/main.cpp b/examples/widgets/statemachine/trafficlight/main.cpp index 5fb6063ca0c..62d335a89bc 100644 --- a/examples/widgets/statemachine/trafficlight/main.cpp +++ b/examples/widgets/statemachine/trafficlight/main.cpp @@ -64,7 +64,7 @@ public slots: void turnOn() { setOn(true); } protected: - virtual void paintEvent(QPaintEvent *) + virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE { if (!m_on) return; diff --git a/examples/widgets/tools/completer/fsmodel.h b/examples/widgets/tools/completer/fsmodel.h index 85b08e532bd..690f8b8569a 100644 --- a/examples/widgets/tools/completer/fsmodel.h +++ b/examples/widgets/tools/completer/fsmodel.h @@ -53,7 +53,7 @@ class FileSystemModel : public QFileSystemModel { public: FileSystemModel(QObject *parent = 0); - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/tools/customcompleter/textedit.h b/examples/widgets/tools/customcompleter/textedit.h index 362db967490..eb0b307b1c7 100644 --- a/examples/widgets/tools/customcompleter/textedit.h +++ b/examples/widgets/tools/customcompleter/textedit.h @@ -60,8 +60,8 @@ public: QCompleter *completer() const; protected: - void keyPressEvent(QKeyEvent *e); - void focusInEvent(QFocusEvent *e); + void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE; private slots: void insertCompletion(const QString &completion); diff --git a/examples/widgets/tools/echoplugin/plugin/echoplugin.h b/examples/widgets/tools/echoplugin/plugin/echoplugin.h index fc6818c5bea..30d9a673e06 100644 --- a/examples/widgets/tools/echoplugin/plugin/echoplugin.h +++ b/examples/widgets/tools/echoplugin/plugin/echoplugin.h @@ -53,7 +53,7 @@ class EchoPlugin : public QObject, EchoInterface Q_INTERFACES(EchoInterface) public: - QString echo(const QString &message); + QString echo(const QString &message) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/tools/i18n/languagechooser.h b/examples/widgets/tools/i18n/languagechooser.h index a2282cdaf5d..3f177a790d5 100644 --- a/examples/widgets/tools/i18n/languagechooser.h +++ b/examples/widgets/tools/i18n/languagechooser.h @@ -61,8 +61,8 @@ public: explicit LanguageChooser(const QString& defaultLang = QString(), QWidget *parent = 0); protected: - bool eventFilter(QObject *object, QEvent *event); - void closeEvent(QCloseEvent *event); + bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void checkBoxToggled(); diff --git a/examples/widgets/tools/plugandpaint/paintarea.h b/examples/widgets/tools/plugandpaint/paintarea.h index 84936576cf2..214e8c9c0ba 100644 --- a/examples/widgets/tools/plugandpaint/paintarea.h +++ b/examples/widgets/tools/plugandpaint/paintarea.h @@ -66,13 +66,13 @@ public: QImage image() const { return theImage; } QColor brushColor() const { return color; } int brushWidth() const { return thickness; } - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; protected: - void paintEvent(QPaintEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private: void setupPainter(QPainter &painter); diff --git a/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h b/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h index 55593f6db06..121501a878f 100644 --- a/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h +++ b/examples/widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h @@ -68,22 +68,22 @@ class BasicToolsPlugin : public QObject, public: //! [1] // BrushInterface - QStringList brushes() const; + QStringList brushes() const Q_DECL_OVERRIDE; QRect mousePress(const QString &brush, QPainter &painter, - const QPoint &pos); + const QPoint &pos) Q_DECL_OVERRIDE; QRect mouseMove(const QString &brush, QPainter &painter, - const QPoint &oldPos, const QPoint &newPos); + const QPoint &oldPos, const QPoint &newPos) Q_DECL_OVERRIDE; QRect mouseRelease(const QString &brush, QPainter &painter, - const QPoint &pos); + const QPoint &pos) Q_DECL_OVERRIDE; // ShapeInterface - QStringList shapes() const; - QPainterPath generateShape(const QString &shape, QWidget *parent); + QStringList shapes() const Q_DECL_OVERRIDE; + QPainterPath generateShape(const QString &shape, QWidget *parent) Q_DECL_OVERRIDE; // FilterInterface - QStringList filters() const; + QStringList filters() const Q_DECL_OVERRIDE; QImage filterImage(const QString &filter, const QImage &image, - QWidget *parent); + QWidget *parent) Q_DECL_OVERRIDE; //! [3] }; //! [2] //! [3] diff --git a/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h b/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h index 6f793b26c60..bc0bae31520 100644 --- a/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h +++ b/examples/widgets/tools/plugandpaintplugins/extrafilters/extrafiltersplugin.h @@ -56,9 +56,9 @@ class ExtraFiltersPlugin : public QObject, public FilterInterface Q_INTERFACES(FilterInterface) public: - QStringList filters() const; + QStringList filters() const Q_DECL_OVERRIDE; QImage filterImage(const QString &filter, const QImage &image, - QWidget *parent); + QWidget *parent) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/tools/settingseditor/settingstree.h b/examples/widgets/tools/settingseditor/settingstree.h index 24c2266899c..663a71c790b 100644 --- a/examples/widgets/tools/settingseditor/settingstree.h +++ b/examples/widgets/tools/settingseditor/settingstree.h @@ -57,7 +57,7 @@ public: SettingsTree(QWidget *parent = 0); void setSettingsObject(QSettings *settings); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; public slots: void setAutoRefresh(bool autoRefresh); @@ -66,7 +66,7 @@ public slots: void refresh(); protected: - bool event(QEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; private slots: void updateSetting(QTreeWidgetItem *item); diff --git a/examples/widgets/tools/settingseditor/variantdelegate.h b/examples/widgets/tools/settingseditor/variantdelegate.h index 0e23c016da4..fed69ef47d3 100644 --- a/examples/widgets/tools/settingseditor/variantdelegate.h +++ b/examples/widgets/tools/settingseditor/variantdelegate.h @@ -52,12 +52,12 @@ public: VariantDelegate(QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - void setEditorData(QWidget *editor, const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; + void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; static bool isSupportedType(QVariant::Type type); static QString displayText(const QVariant &value); diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyle.h b/examples/widgets/tools/styleplugin/plugin/simplestyle.h index 2db04d206f5..95c04c5355f 100644 --- a/examples/widgets/tools/styleplugin/plugin/simplestyle.h +++ b/examples/widgets/tools/styleplugin/plugin/simplestyle.h @@ -54,7 +54,7 @@ class SimpleStyle : public QProxyStyle public: SimpleStyle() {}; - void polish(QPalette &palette); + void polish(QPalette &palette) Q_DECL_OVERRIDE; }; #endif diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h index 22965de1213..77739168e4b 100644 --- a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h +++ b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h @@ -58,7 +58,7 @@ public: SimpleStylePlugin() {} QStringList keys() const; - QStyle *create(const QString &key); + QStyle *create(const QString &key) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h index 69d6cdfe784..2f2a45c3d32 100644 --- a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h +++ b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h @@ -58,8 +58,8 @@ public slots: void setSeparator(const QString &separator); protected: - QStringList splitPath(const QString &path) const; - QString pathFromIndex(const QModelIndex &index) const; + QStringList splitPath(const QString &path) const Q_DECL_OVERRIDE; + QString pathFromIndex(const QModelIndex &index) const Q_DECL_OVERRIDE; private: QString sep; diff --git a/examples/widgets/tools/undo/commands.h b/examples/widgets/tools/undo/commands.h index b8984c1d34b..f75ac34256b 100644 --- a/examples/widgets/tools/undo/commands.h +++ b/examples/widgets/tools/undo/commands.h @@ -49,8 +49,8 @@ class AddShapeCommand : public QUndoCommand { public: AddShapeCommand(Document *doc, const Shape &shape, QUndoCommand *parent = 0); - void undo(); - void redo(); + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; private: Document *m_doc; @@ -62,8 +62,8 @@ class RemoveShapeCommand : public QUndoCommand { public: RemoveShapeCommand(Document *doc, const QString &shapeName, QUndoCommand *parent = 0); - void undo(); - void redo(); + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; private: Document *m_doc; @@ -77,11 +77,11 @@ public: SetShapeColorCommand(Document *doc, const QString &shapeName, const QColor &color, QUndoCommand *parent = 0); - void undo(); - void redo(); + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; - bool mergeWith(const QUndoCommand *command); - int id() const; + bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE; + int id() const Q_DECL_OVERRIDE; private: Document *m_doc; @@ -96,11 +96,11 @@ public: SetShapeRectCommand(Document *doc, const QString &shapeName, const QRect &rect, QUndoCommand *parent = 0); - void undo(); - void redo(); + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; - bool mergeWith(const QUndoCommand *command); - int id() const; + bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE; + int id() const Q_DECL_OVERRIDE; private: Document *m_doc; diff --git a/examples/widgets/tools/undo/document.h b/examples/widgets/tools/undo/document.h index 4f362a95971..9246c9320d7 100644 --- a/examples/widgets/tools/undo/document.h +++ b/examples/widgets/tools/undo/document.h @@ -101,10 +101,10 @@ signals: void currentShapeChanged(const QString &shapeName); protected: - void paintEvent(QPaintEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private: void setCurrentShape(int index); diff --git a/examples/widgets/tools/undoframework/commands.h b/examples/widgets/tools/undoframework/commands.h index f15e586e915..0e68c5f533a 100644 --- a/examples/widgets/tools/undoframework/commands.h +++ b/examples/widgets/tools/undoframework/commands.h @@ -54,10 +54,10 @@ public: MoveCommand(DiagramItem *diagramItem, const QPointF &oldPos, QUndoCommand *parent = 0); - void undo(); - void redo(); - bool mergeWith(const QUndoCommand *command); - int id() const { return Id; } + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; + bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE; + int id() const Q_DECL_OVERRIDE { return Id; } private: DiagramItem *myDiagramItem; @@ -72,8 +72,8 @@ class DeleteCommand : public QUndoCommand public: explicit DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0); - void undo(); - void redo(); + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; private: DiagramItem *myDiagramItem; @@ -89,8 +89,8 @@ public: QUndoCommand *parent = 0); ~AddCommand(); - void undo(); - void redo(); + void undo() Q_DECL_OVERRIDE; + void redo() Q_DECL_OVERRIDE; private: DiagramItem *myDiagramItem; diff --git a/examples/widgets/tools/undoframework/diagramitem.h b/examples/widgets/tools/undoframework/diagramitem.h index 2c115c3b203..44495fc57e4 100644 --- a/examples/widgets/tools/undoframework/diagramitem.h +++ b/examples/widgets/tools/undoframework/diagramitem.h @@ -61,7 +61,7 @@ public: DiagramType diagramType() const { return polygon() == boxPolygon ? Box : Triangle; } - int type() const { return Type; } + int type() const Q_DECL_OVERRIDE { return Type; } private: QPolygonF boxPolygon; diff --git a/examples/widgets/tools/undoframework/diagramscene.h b/examples/widgets/tools/undoframework/diagramscene.h index 6ad9647df52..925ab450d25 100644 --- a/examples/widgets/tools/undoframework/diagramscene.h +++ b/examples/widgets/tools/undoframework/diagramscene.h @@ -62,8 +62,8 @@ signals: void itemMoved(DiagramItem *movedItem, const QPointF &movedFromPosition); protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE; private: QGraphicsItem *movingItem; diff --git a/examples/widgets/tutorials/modelview/1_readonly/mymodel.h b/examples/widgets/tutorials/modelview/1_readonly/mymodel.h index e1dd4be4784..d17f409da33 100644 --- a/examples/widgets/tutorials/modelview/1_readonly/mymodel.h +++ b/examples/widgets/tutorials/modelview/1_readonly/mymodel.h @@ -50,9 +50,9 @@ class MyModel : public QAbstractTableModel Q_OBJECT public: MyModel(QObject *parent); - int rowCount(const QModelIndex &parent = QModelIndex()) const ; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; }; //! [Quoting ModelView Tutorial] diff --git a/examples/widgets/tutorials/modelview/2_formatting/mymodel.h b/examples/widgets/tutorials/modelview/2_formatting/mymodel.h index 3ae0b7b0090..39e431be414 100644 --- a/examples/widgets/tutorials/modelview/2_formatting/mymodel.h +++ b/examples/widgets/tutorials/modelview/2_formatting/mymodel.h @@ -48,9 +48,9 @@ class MyModel : public QAbstractTableModel Q_OBJECT public: MyModel(QObject *parent); - int rowCount(const QModelIndex &parent = QModelIndex()) const ; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; }; #endif // MYMODEL_H diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h b/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h index d59eddc6bb3..56184772bf6 100644 --- a/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h +++ b/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h @@ -49,9 +49,9 @@ class MyModel : public QAbstractTableModel Q_OBJECT public: MyModel(QObject *parent); - int rowCount(const QModelIndex &parent = QModelIndex()) const ; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; QTimer *timer; private: int selectedCell; diff --git a/examples/widgets/tutorials/modelview/4_headers/mymodel.h b/examples/widgets/tutorials/modelview/4_headers/mymodel.h index d8fd1ff10a9..3d4992dc483 100644 --- a/examples/widgets/tutorials/modelview/4_headers/mymodel.h +++ b/examples/widgets/tutorials/modelview/4_headers/mymodel.h @@ -48,10 +48,10 @@ class MyModel : public QAbstractTableModel Q_OBJECT public: MyModel(QObject *parent); - int rowCount(const QModelIndex &parent = QModelIndex()) const ; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE; }; #endif // MYMODEL_H diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.h b/examples/widgets/tutorials/modelview/5_edit/mymodel.h index 2aa54ff5aed..be6ebc28c95 100644 --- a/examples/widgets/tutorials/modelview/5_edit/mymodel.h +++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.h @@ -55,11 +55,11 @@ class MyModel : public QAbstractTableModel Q_OBJECT public: MyModel(QObject *parent); - int rowCount(const QModelIndex &parent = QModelIndex()) const ; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); - Qt::ItemFlags flags(const QModelIndex & index) const ; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE ; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex & index) const Q_DECL_OVERRIDE ; private: QString m_gridData[ROWS][COLS]; //holds text entered into QTableView signals: diff --git a/examples/widgets/widgets/analogclock/analogclock.h b/examples/widgets/widgets/analogclock/analogclock.h index a675e2b05d7..9a12277d2fe 100644 --- a/examples/widgets/widgets/analogclock/analogclock.h +++ b/examples/widgets/widgets/analogclock/analogclock.h @@ -52,7 +52,7 @@ public: AnalogClock(QWidget *parent = 0); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/widgets/calculator/button.h b/examples/widgets/widgets/calculator/button.h index aec6e10af8c..7cc28b079c3 100644 --- a/examples/widgets/widgets/calculator/button.h +++ b/examples/widgets/widgets/calculator/button.h @@ -51,7 +51,7 @@ class Button : public QToolButton public: explicit Button(const QString &text, QWidget *parent = 0); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/widgets/charactermap/characterwidget.h b/examples/widgets/widgets/charactermap/characterwidget.h index 96bafd42220..d5ba947aa26 100644 --- a/examples/widgets/widgets/charactermap/characterwidget.h +++ b/examples/widgets/widgets/charactermap/characterwidget.h @@ -59,7 +59,7 @@ class CharacterWidget : public QWidget public: CharacterWidget(QWidget *parent = 0); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; public slots: void updateFont(const QFont &font); @@ -71,9 +71,9 @@ signals: void characterSelected(const QString &character); protected: - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: QFont displayFont; diff --git a/examples/widgets/widgets/codeeditor/codeeditor.h b/examples/widgets/widgets/codeeditor/codeeditor.h index 86681407287..ac723186546 100644 --- a/examples/widgets/widgets/codeeditor/codeeditor.h +++ b/examples/widgets/widgets/codeeditor/codeeditor.h @@ -66,7 +66,7 @@ public: int lineNumberAreaWidth(); protected: - void resizeEvent(QResizeEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private slots: void updateLineNumberAreaWidth(int newBlockCount); @@ -87,12 +87,12 @@ public: codeEditor = editor; } - QSize sizeHint() const { + QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(codeEditor->lineNumberAreaWidth(), 0); } protected: - void paintEvent(QPaintEvent *event) { + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE { codeEditor->lineNumberAreaPaintEvent(event); } diff --git a/examples/widgets/widgets/elidedlabel/elidedlabel.h b/examples/widgets/widgets/elidedlabel/elidedlabel.h index cf4aaea14c6..409dd777eb7 100644 --- a/examples/widgets/widgets/elidedlabel/elidedlabel.h +++ b/examples/widgets/widgets/elidedlabel/elidedlabel.h @@ -62,7 +62,7 @@ public: bool isElided() const { return elided; } protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; signals: void elisionChanged(bool elided); diff --git a/examples/widgets/widgets/elidedlabel/testwidget.h b/examples/widgets/widgets/elidedlabel/testwidget.h index edc611a0c67..7beb54978f5 100644 --- a/examples/widgets/widgets/elidedlabel/testwidget.h +++ b/examples/widgets/widgets/elidedlabel/testwidget.h @@ -57,7 +57,7 @@ public: TestWidget(QWidget *parent = 0); protected: - void resizeEvent(QResizeEvent *event); + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private slots: void switchText(); diff --git a/examples/widgets/widgets/icons/iconsizespinbox.h b/examples/widgets/widgets/icons/iconsizespinbox.h index fff8a87ff1f..a7704e147c8 100644 --- a/examples/widgets/widgets/icons/iconsizespinbox.h +++ b/examples/widgets/widgets/icons/iconsizespinbox.h @@ -51,8 +51,8 @@ class IconSizeSpinBox : public QSpinBox public: IconSizeSpinBox(QWidget *parent = 0); - int valueFromText(const QString &text) const; - QString textFromValue(int value) const; + int valueFromText(const QString &text) const Q_DECL_OVERRIDE; + QString textFromValue(int value) const Q_DECL_OVERRIDE; }; //! [0] diff --git a/examples/widgets/widgets/icons/imagedelegate.h b/examples/widgets/widgets/icons/imagedelegate.h index e3777d4130d..7d143d2140e 100644 --- a/examples/widgets/widgets/icons/imagedelegate.h +++ b/examples/widgets/widgets/icons/imagedelegate.h @@ -54,10 +54,10 @@ public: //! [1] QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - void setEditorData(QWidget *editor, const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; + void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; + const QModelIndex &index) const Q_DECL_OVERRIDE; //! [1] //! [2] private slots: diff --git a/examples/widgets/widgets/mousebuttons/buttontester.h b/examples/widgets/widgets/mousebuttons/buttontester.h index 156a44e9d0b..9e7011ac9a3 100644 --- a/examples/widgets/widgets/mousebuttons/buttontester.h +++ b/examples/widgets/widgets/mousebuttons/buttontester.h @@ -53,11 +53,11 @@ class ButtonTester : public QTextEdit Q_OBJECT protected: - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; #ifndef QT_NO_WHEELEVENT - void wheelEvent(QWheelEvent * event); + void wheelEvent(QWheelEvent * event) Q_DECL_OVERRIDE; #endif int buttonByNumber(const Qt::MouseButton button); QString enumNameFromValue(const Qt::MouseButton button); diff --git a/examples/widgets/widgets/scribble/mainwindow.h b/examples/widgets/widgets/scribble/mainwindow.h index 276052c10c0..a26976be1bc 100644 --- a/examples/widgets/widgets/scribble/mainwindow.h +++ b/examples/widgets/widgets/scribble/mainwindow.h @@ -55,7 +55,7 @@ public: MainWindow(); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; private slots: void open(); diff --git a/examples/widgets/widgets/scribble/scribblearea.h b/examples/widgets/widgets/scribble/scribblearea.h index 3b984426a9f..f92d41157de 100644 --- a/examples/widgets/widgets/scribble/scribblearea.h +++ b/examples/widgets/widgets/scribble/scribblearea.h @@ -68,11 +68,11 @@ public slots: void print(); protected: - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private: void drawLineTo(const QPoint &endPoint); diff --git a/examples/widgets/widgets/shapedclock/shapedclock.h b/examples/widgets/widgets/shapedclock/shapedclock.h index f98489e9f38..e94963d9043 100644 --- a/examples/widgets/widgets/shapedclock/shapedclock.h +++ b/examples/widgets/widgets/shapedclock/shapedclock.h @@ -50,13 +50,13 @@ class ShapedClock : public QWidget public: ShapedClock(QWidget *parent = 0); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; protected: - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private: QPoint dragPosition; diff --git a/examples/widgets/widgets/styles/norwegianwoodstyle.h b/examples/widgets/widgets/styles/norwegianwoodstyle.h index 0a1ec93b818..e4eebabb794 100644 --- a/examples/widgets/widgets/styles/norwegianwoodstyle.h +++ b/examples/widgets/widgets/styles/norwegianwoodstyle.h @@ -56,17 +56,17 @@ class NorwegianWoodStyle : public QProxyStyle public: NorwegianWoodStyle(); - void polish(QPalette &palette); - void polish(QWidget *widget); - void unpolish(QWidget *widget); + void polish(QPalette &palette) Q_DECL_OVERRIDE; + void polish(QWidget *widget) Q_DECL_OVERRIDE; + void unpolish(QWidget *widget) Q_DECL_OVERRIDE; int pixelMetric(PixelMetric metric, const QStyleOption *option, - const QWidget *widget) const; + const QWidget *widget) const Q_DECL_OVERRIDE; int styleHint(StyleHint hint, const QStyleOption *option, - const QWidget *widget, QStyleHintReturn *returnData) const; + const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE; void drawPrimitive(PrimitiveElement element, const QStyleOption *option, - QPainter *painter, const QWidget *widget) const; + QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; void drawControl(ControlElement control, const QStyleOption *option, - QPainter *painter, const QWidget *widget) const; + QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE; private: static void setTexture(QPalette &palette, QPalette::ColorRole role, diff --git a/examples/widgets/widgets/tablet/tabletapplication.h b/examples/widgets/widgets/tablet/tabletapplication.h index c6e9ad13553..0e99fd0721a 100644 --- a/examples/widgets/widgets/tablet/tabletapplication.h +++ b/examples/widgets/widgets/tablet/tabletapplication.h @@ -54,7 +54,7 @@ public: TabletApplication(int &argv, char **args) : QApplication(argv, args) {} - bool event(QEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; void setCanvas(TabletCanvas *canvas) { myCanvas = canvas; } diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h index 27f8afcd55a..beb3cdc4716 100644 --- a/examples/widgets/widgets/tablet/tabletcanvas.h +++ b/examples/widgets/widgets/tablet/tabletcanvas.h @@ -86,9 +86,9 @@ public: { return a > b ? a : b; } protected: - void tabletEvent(QTabletEvent *event); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); + void tabletEvent(QTabletEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; private: void initPixmap(); diff --git a/examples/widgets/widgets/tetrix/tetrixboard.h b/examples/widgets/widgets/tetrix/tetrixboard.h index ec4b81e29f3..b36ba32fbe9 100644 --- a/examples/widgets/widgets/tetrix/tetrixboard.h +++ b/examples/widgets/widgets/tetrix/tetrixboard.h @@ -60,8 +60,8 @@ public: TetrixBoard(QWidget *parent = 0); void setNextPieceLabel(QLabel *label); - QSize sizeHint() const; - QSize minimumSizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; public slots: void start(); @@ -73,9 +73,9 @@ signals: void linesRemovedChanged(int numLines); protected: - void paintEvent(QPaintEvent *event); - void keyPressEvent(QKeyEvent *event); - void timerEvent(QTimerEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; //! [0] //! [1] diff --git a/examples/widgets/widgets/tooltips/sortingbox.h b/examples/widgets/widgets/tooltips/sortingbox.h index 65c3cd89b24..50a0b1933c1 100644 --- a/examples/widgets/widgets/tooltips/sortingbox.h +++ b/examples/widgets/widgets/tooltips/sortingbox.h @@ -60,12 +60,12 @@ public: SortingBox(); protected: - bool event(QEvent *event); - void resizeEvent(QResizeEvent *event); - void paintEvent(QPaintEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); + bool event(QEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; private slots: void createNewCircle(); diff --git a/examples/widgets/widgets/wiggly/wigglywidget.h b/examples/widgets/widgets/wiggly/wigglywidget.h index 8f3ed13787b..620d8bdebb3 100644 --- a/examples/widgets/widgets/wiggly/wigglywidget.h +++ b/examples/widgets/widgets/wiggly/wigglywidget.h @@ -56,8 +56,8 @@ public slots: void setText(const QString &newText) { text = newText; } protected: - void paintEvent(QPaintEvent *event); - void timerEvent(QTimerEvent *event); + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; private: QBasicTimer timer; diff --git a/examples/widgets/windowcontainer/windowcontainer.cpp b/examples/widgets/windowcontainer/windowcontainer.cpp index 42523a53d0b..ad19949ee3f 100644 --- a/examples/widgets/windowcontainer/windowcontainer.cpp +++ b/examples/widgets/windowcontainer/windowcontainer.cpp @@ -63,7 +63,7 @@ public: { } - void render(QPainter *p) { + void render(QPainter *p) Q_DECL_OVERRIDE { QLinearGradient g(0, 0, 0, height()); g.setColorAt(0, QColor("lightsteelblue")); g.setColorAt(1, Qt::black); @@ -91,43 +91,43 @@ public: p->drawPolyline(m_polygon); } - void mousePressEvent(QMouseEvent *e) { + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE { m_mouseDown = true; m_polygon.clear(); m_polygon.append(e->pos()); renderLater(); } - void mouseMoveEvent(QMouseEvent *e) { + void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE { if (m_mouseDown) { m_polygon.append(e->pos()); renderLater(); } } - void mouseReleaseEvent(QMouseEvent *e) { + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE { m_mouseDown = false; m_polygon.append(e->pos()); renderLater(); } - void focusInEvent(QFocusEvent *) { + void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE { m_focus = true; renderLater(); } - void focusOutEvent(QFocusEvent *) { + void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE { m_focus = false; m_polygon.clear(); renderLater(); } - void keyPressEvent(QKeyEvent *e) { + void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE { m_key = e->text(); renderLater(); } - void keyReleaseEvent(QKeyEvent *) { + void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE { m_key = QString(); renderLater(); } diff --git a/examples/xml/saxbookmarks/xbelhandler.h b/examples/xml/saxbookmarks/xbelhandler.h index 27b7e280dbc..0646ee796a0 100644 --- a/examples/xml/saxbookmarks/xbelhandler.h +++ b/examples/xml/saxbookmarks/xbelhandler.h @@ -55,12 +55,12 @@ public: XbelHandler(QTreeWidget *treeWidget); bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &attributes); + const QString &qName, const QXmlAttributes &attributes) Q_DECL_OVERRIDE; bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - bool characters(const QString &str); - bool fatalError(const QXmlParseException &exception); - QString errorString() const; + const QString &qName) Q_DECL_OVERRIDE; + bool characters(const QString &str) Q_DECL_OVERRIDE; + bool fatalError(const QXmlParseException &exception) Q_DECL_OVERRIDE; + QString errorString() const Q_DECL_OVERRIDE; private: QTreeWidgetItem *createChildItem(const QString &tagName); |