From 47c92fbb0b588b443cead18a5aad5a2b5ad9e4d7 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 18 Sep 2017 10:36:49 +0200 Subject: Replace Q_DECL_OVERRIDE with override where possible Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll Reviewed-by: Ville Voutilainen Reviewed-by: Olivier Goffart (Woboq GmbH) --- .../qtconcurrentrun/tst_qtconcurrentrun.cpp | 2 +- .../corelib/codecs/qtextcodec/tst_qtextcodec.cpp | 10 +++--- tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp | 10 +++--- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 2 +- .../corelib/io/qtextstream/tst_qtextstream.cpp | 4 +-- .../tst_qsortfilterproxymodel.cpp | 4 +-- .../qcoreapplication/tst_qcoreapplication.cpp | 4 +-- .../qstatemachine/tst_qstatemachine.cpp | 2 +- tests/auto/corelib/thread/qfuture/tst_qfuture.cpp | 6 ++-- tests/auto/corelib/tools/qvector/tst_qvector.cpp | 2 +- .../gui/kernel/qopenglwindow/tst_qopenglwindow.cpp | 16 ++++----- .../gui/kernel/qrasterwindow/tst_qrasterwindow.cpp | 2 +- .../gui/kernel/qtouchevent/tst_qtouchevent.cpp | 10 +++--- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 2 +- .../auto/gui/text/qstatictext/tst_qstatictext.cpp | 14 ++++---- tests/auto/network/access/http2/http2srv.h | 2 +- .../socket/qlocalsocket/tst_qlocalsocket.cpp | 2 +- .../auto/other/qaccessibility/accessiblewidgets.h | 2 +- .../tools/moc/cxx11-explicit-override-control.h | 40 +++++++++++----------- .../dialogs/qmessagebox/tst_qmessagebox.cpp | 2 +- .../qprogressdialog/tst_qprogressdialog.cpp | 4 +-- .../tst_qgraphicslinearlayout.cpp | 2 +- .../qgraphicswidget/tst_qgraphicswidget.cpp | 6 ++-- .../qabstractitemview/tst_qabstractitemview.cpp | 12 +++---- .../itemviews/qheaderview/tst_qheaderview.cpp | 2 +- .../widgets/itemviews/qtreeview/tst_qtreeview.cpp | 2 +- .../qgesturerecognizer/tst_qgesturerecognizer.cpp | 2 +- .../widgets/kernel/qshortcut/tst_qshortcut.cpp | 2 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 8 ++--- .../kernel/qwidget_window/tst_qwidget_window.cpp | 8 ++--- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 26 +++++++------- tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp | 2 +- tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp | 8 ++--- .../widgets/qopenglwidget/tst_qopenglwidget.cpp | 16 ++++----- .../widgets/widgets/qsplitter/tst_qsplitter.cpp | 2 +- .../widgets/widgets/qtextedit/tst_qtextedit.cpp | 2 +- .../corelib/thread/qthreadpool/tst_qthreadpool.cpp | 2 +- tests/manual/cocoa/menurama/mainwindow.h | 2 +- tests/manual/highdpi/dragwidget.h | 18 +++++----- tests/manual/qscreen/main.cpp | 6 ++-- tests/manual/touch/main.cpp | 10 +++--- .../qgraphicsview/rubberband/rubberbandtest.cpp | 4 +-- 42 files changed, 142 insertions(+), 142 deletions(-) (limited to 'tests') diff --git a/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp index 4e3668d72e..1596a9fafd 100644 --- a/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp +++ b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp @@ -572,7 +572,7 @@ class SlowTask : public QRunnable { public: static QAtomicInt cancel; - void run() Q_DECL_OVERRIDE { + void run() override { int iter = 60; while (--iter && !cancel.load()) QThread::currentThread()->msleep(25); diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index c3b53a2fc0..f8f9387abb 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -2406,16 +2406,16 @@ void tst_QTextCodec::shiftJis() struct UserCodec : public QTextCodec { // implement pure virtuals - QByteArray name() const Q_DECL_OVERRIDE + QByteArray name() const override { return "UserCodec"; } - QList aliases() const Q_DECL_OVERRIDE + QList aliases() const override { return QList() << "usercodec" << "user-codec"; } - int mibEnum() const Q_DECL_OVERRIDE + int mibEnum() const override { return 5000; } - virtual QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE + virtual QString convertToUnicode(const char *, int, ConverterState *) const override { return QString(); } - virtual QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE + virtual QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override { return QByteArray(); } }; diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index a0188f8ba9..a485788ec2 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -551,18 +551,18 @@ public: : QIODevice(), buf(byteArray), offset(0), ownbuf(false) { } virtual ~SequentialReadBuffer() { if (ownbuf) delete buf; } - bool isSequential() const Q_DECL_OVERRIDE { return true; } + bool isSequential() const override { return true; } const QByteArray &buffer() const { return *buf; } protected: - qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE + qint64 readData(char *data, qint64 maxSize) override { maxSize = qMin(maxSize, qint64(buf->size() - offset)); memcpy(data, buf->constData() + offset, maxSize); offset += maxSize; return maxSize; } - qint64 writeData(const char * /* data */, qint64 /* maxSize */) Q_DECL_OVERRIDE + qint64 writeData(const char * /* data */, qint64 /* maxSize */) override { return -1; } @@ -598,13 +598,13 @@ public: RandomAccessBuffer(const char *data) : QIODevice(), buf(data) { } protected: - qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE + qint64 readData(char *data, qint64 maxSize) override { maxSize = qMin(maxSize, qint64(buf.size() - pos())); memcpy(data, buf.constData() + pos(), maxSize); return maxSize; } - qint64 writeData(const char *data, qint64 maxSize) Q_DECL_OVERRIDE + qint64 writeData(const char *data, qint64 maxSize) override { maxSize = qMin(maxSize, qint64(buf.size() - pos())); memcpy(buf.data() + pos(), data, maxSize); diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index de6eb28503..881919fe4c 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -285,7 +285,7 @@ void tst_QProcess::startWithOldOpen() class OverriddenOpen : public QProcess { public: - virtual bool open(OpenMode mode) Q_DECL_OVERRIDE + virtual bool open(OpenMode mode) override { return QIODevice::open(mode); } }; diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 0e423a56ca..1aa15df590 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -609,14 +609,14 @@ void tst_QTextStream::readLinesFromBufferCRCR() class ErrorDevice : public QIODevice { protected: - qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE + qint64 readData(char *data, qint64 maxlen) override { Q_UNUSED(data) Q_UNUSED(maxlen) return -1; } - qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE + qint64 writeData(const char *data, qint64 len) override { Q_UNUSED(data) Q_UNUSED(len) diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 383bbbd3f8..74e9e4e47d 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -4072,11 +4072,11 @@ public: } bool canDropMimeData(const QMimeData *, Qt::DropAction, - int row, int /* column */, const QModelIndex & /* parent */) const Q_DECL_OVERRIDE + int row, int /* column */, const QModelIndex & /* parent */) const override { return row == 1; } bool dropMimeData(const QMimeData *, Qt::DropAction, - int row, int /* column */, const QModelIndex & /* parent */) Q_DECL_OVERRIDE + int row, int /* column */, const QModelIndex & /* parent */) override { return row == 1; } }; diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 22f0d8ecaa..5e9dbdd226 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -56,7 +56,7 @@ class ThreadedEventReceiver : public QObject Q_OBJECT public: QList recordedEvents; - bool event(QEvent *event) Q_DECL_OVERRIDE + bool event(QEvent *event) override { if (event->type() != QEvent::Type(QEvent::User + 1)) return QObject::event(event); @@ -70,7 +70,7 @@ public: class Thread : public QDaemonThread { - void run() Q_DECL_OVERRIDE + void run() override { QThreadData *data = QThreadData::current(); QVERIFY(!data->requiresCoreApplication); // daemon thread diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp index 8f0d83ce32..c30efe4e3b 100644 --- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp @@ -6634,7 +6634,7 @@ void tst_QStateMachine::postEventFromBeginSelectTransitions() { class StateMachine : public QStateMachine { protected: - void beginSelectTransitions(QEvent* e) Q_DECL_OVERRIDE { + void beginSelectTransitions(QEvent* e) override { if (e->type() == QEvent::Type(QEvent::User + 2)) postEvent(new QEvent(QEvent::Type(QEvent::User + 1)), QStateMachine::HighPriority); } diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp index 37b052bf1d..408a90afc4 100644 --- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp +++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp @@ -1303,8 +1303,8 @@ QFuture createExceptionResultFuture() class DerivedException : public QException { public: - void raise() const Q_DECL_OVERRIDE { throw *this; } - DerivedException *clone() const Q_DECL_OVERRIDE { return new DerivedException(*this); } + void raise() const override { throw *this; } + DerivedException *clone() const override { return new DerivedException(*this); } }; QFuture createDerivedExceptionFuture() @@ -1454,7 +1454,7 @@ void tst_QFuture::nonGlobalThreadPool() return f; } - void run() Q_DECL_OVERRIDE + void run() override { const int ms = 100 + (qrand() % 100 - 100/2); QThread::msleep(ms); diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp index 374fec221e..56daea31fe 100644 --- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp +++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp @@ -2803,7 +2803,7 @@ void tst_QVector::detachThreadSafety() const static const uint threadsCount = 5; struct : QThread { - void run() Q_DECL_OVERRIDE + void run() override { QVector copy(*detachThreadSafetyData()->load()); QVERIFY(!copy.isDetached()); diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp index 58dee6f6ca..7200d1cc8a 100644 --- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp +++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp @@ -74,17 +74,17 @@ public: initCount = resizeCount = paintCount = 0; } - void initializeGL() Q_DECL_OVERRIDE { + void initializeGL() override { ++initCount; } - void resizeGL(int w, int h) Q_DECL_OVERRIDE { + void resizeGL(int w, int h) override { ++resizeCount; QCOMPARE(w, size().width()); QCOMPARE(h, size().height()); } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { ++paintCount; QOpenGLContext *ctx = QOpenGLContext::currentContext(); @@ -144,7 +144,7 @@ void tst_QOpenGLWindow::basic() class PainterWindow : public QOpenGLWindow { public: - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { QOpenGLContext *ctx = QOpenGLContext::currentContext(); QVERIFY(ctx); QCOMPARE(ctx, context()); @@ -183,7 +183,7 @@ public: PartialPainterWindow(QOpenGLWindow::UpdateBehavior u) : QOpenGLWindow(u), x(0) { } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { ++paintCount; QPainter p(this); @@ -244,7 +244,7 @@ public: Error } m_state; - void paintUnderGL() Q_DECL_OVERRIDE { + void paintUnderGL() override { if (m_state == None || m_state == PaintOver) m_state = PaintUnder; else @@ -255,7 +255,7 @@ public: QCOMPARE(fbo, GLuint(0)); } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { if (m_state == PaintUnder) m_state = Paint; else @@ -268,7 +268,7 @@ public: QCOMPARE(fbo, defaultFramebufferObject()); } - void paintOverGL() Q_DECL_OVERRIDE { + void paintOverGL() override { if (m_state == Paint) m_state = PaintOver; else diff --git a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp index 41fcdf9f30..7fb79b28ae 100644 --- a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp +++ b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp @@ -54,7 +54,7 @@ class PainterWindow : public QRasterWindow public: void reset() { paintCount = 0; } - void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE { + void paintEvent(QPaintEvent*) override { ++paintCount; QPainter p(this); p.fillRect(QRect(0, 0, 100, 100), Qt::blue); diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp index ec143896ab..d56b09b75d 100644 --- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp @@ -63,7 +63,7 @@ public: deleteInTouchBegin = deleteInTouchUpdate = deleteInTouchEnd = false; } - bool event(QEvent *event) Q_DECL_OVERRIDE + bool event(QEvent *event) override { switch (event->type()) { case QEvent::TouchBegin: @@ -140,13 +140,13 @@ public: deleteInTouchBegin = deleteInTouchUpdate = deleteInTouchEnd = false; } - QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(0, 0, 10, 10); } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE + QRectF boundingRect() const override { return QRectF(0, 0, 10, 10); } + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override { painter->fillRect(QRectF(QPointF(0, 0), boundingRect().size()), Qt::yellow); } - bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE + bool sceneEvent(QEvent *event) override { switch (event->type()) { case QEvent::TouchBegin: @@ -1628,7 +1628,7 @@ class WindowTouchEventFilter : public QObject { Q_OBJECT public: - bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *obj, QEvent *event) override; struct TouchInfo { QList points; QEvent::Type lastSeenType; diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index fc9f50b15c..40f825fa4a 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -352,7 +352,7 @@ private: class ColoredWindow : public QRasterWindow { public: explicit ColoredWindow(const QColor &color, QWindow *parent = 0) : QRasterWindow(parent), m_color(color) {} - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE + void paintEvent(QPaintEvent *) override { QPainter p(this); p.fillRect(QRect(QPoint(0, 0), size()), m_color); diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp index f4e3356ad0..9ade3b554e 100644 --- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp @@ -862,19 +862,19 @@ void tst_QStaticText::textDocumentColor() class TestPaintEngine: public QPaintEngine { public: - void drawTextItem(const QPointF &p, const QTextItem &) Q_DECL_OVERRIDE + void drawTextItem(const QPointF &p, const QTextItem &) override { differentVerticalPositions.insert(qRound(p.y())); } - void updateState(const QPaintEngineState &) Q_DECL_OVERRIDE {} + void updateState(const QPaintEngineState &) override {} - void drawPolygon(const QPointF *, int , PolygonDrawMode ) Q_DECL_OVERRIDE {} + void drawPolygon(const QPointF *, int , PolygonDrawMode ) override {} - bool begin(QPaintDevice *) Q_DECL_OVERRIDE { return true; } - bool end() Q_DECL_OVERRIDE { return true; } - void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) Q_DECL_OVERRIDE {} - Type type() const Q_DECL_OVERRIDE + bool begin(QPaintDevice *) override { return true; } + bool end() override { return true; } + void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) override {} + Type type() const override { return User; } diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h index 10d0e86736..f89e04cc0d 100644 --- a/tests/auto/network/access/http2/http2srv.h +++ b/tests/auto/network/access/http2/http2srv.h @@ -129,7 +129,7 @@ private slots: void readReady(); private: - void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE; + void incomingConnection(qintptr socketDescriptor) override; quint32 clientSetting(Http2::Settings identifier, quint32 defaultValue); bool readMethodLine(); diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 7760138067..0d538865a3 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -476,7 +476,7 @@ void tst_QLocalSocket::connectWithOldOpen() class OverriddenOpen : public LocalSocket { public: - virtual bool open(OpenMode mode) Q_DECL_OVERRIDE + virtual bool open(OpenMode mode) override { return QIODevice::open(mode); } }; diff --git a/tests/auto/other/qaccessibility/accessiblewidgets.h b/tests/auto/other/qaccessibility/accessiblewidgets.h index 0c337a72f4..d436f81d17 100644 --- a/tests/auto/other/qaccessibility/accessiblewidgets.h +++ b/tests/auto/other/qaccessibility/accessiblewidgets.h @@ -47,7 +47,7 @@ class QtTestAccessibleWidgetIface: public QAccessibleWidget { public: QtTestAccessibleWidgetIface(QtTestAccessibleWidget *w): QAccessibleWidget(w) {} - QString text(QAccessible::Text t) const Q_DECL_OVERRIDE + QString text(QAccessible::Text t) const override { if (t == QAccessible::Help) return QString::fromLatin1("Help yourself"); diff --git a/tests/auto/tools/moc/cxx11-explicit-override-control.h b/tests/auto/tools/moc/cxx11-explicit-override-control.h index f361a47248..2211112717 100644 --- a/tests/auto/tools/moc/cxx11-explicit-override-control.h +++ b/tests/auto/tools/moc/cxx11-explicit-override-control.h @@ -132,17 +132,17 @@ public: : ExplicitOverrideControlBase(parent) {} private Q_SLOTS: - void pureSlot0() Q_DECL_OVERRIDE {} - void pureSlot1() Q_DECL_OVERRIDE {} - void pureSlot2() const Q_DECL_OVERRIDE {} - void pureSlot3() Q_DECL_OVERRIDE const {} + void pureSlot0() override {} + void pureSlot1() override {} + void pureSlot2() const override {} + void pureSlot3() override const {} #if 0 // moc doesn't support volatile slots - void pureSlot4() volatile Q_DECL_OVERRIDE {} - void pureSlot5() Q_DECL_OVERRIDE volatile {} - void pureSlot6() const volatile Q_DECL_OVERRIDE {} - void pureSlot7() volatile Q_DECL_OVERRIDE const {} - void pureSlot8() const Q_DECL_OVERRIDE volatile {} - void pureSlot9() Q_DECL_OVERRIDE volatile const {} + void pureSlot4() volatile override {} + void pureSlot5() override volatile {} + void pureSlot6() const volatile override {} + void pureSlot7() volatile override const {} + void pureSlot8() const override volatile {} + void pureSlot9() override volatile const {} #endif }; @@ -176,17 +176,17 @@ public: : ExplicitOverrideControlBase(parent) {} private Q_SLOTS: - void pureSlot0() Q_DECL_FINAL Q_DECL_OVERRIDE {} - void pureSlot1() Q_DECL_OVERRIDE Q_DECL_FINAL {} - void pureSlot2() Q_DECL_OVERRIDE const Q_DECL_FINAL {} - void pureSlot3() Q_DECL_FINAL const Q_DECL_OVERRIDE {} + void pureSlot0() Q_DECL_FINAL override {} + void pureSlot1() override Q_DECL_FINAL {} + void pureSlot2() override const Q_DECL_FINAL {} + void pureSlot3() Q_DECL_FINAL const override {} #if 0 // moc doesn't support volatile slots - void pureSlot4() volatile Q_DECL_FINAL Q_DECL_OVERRIDE {} - void pureSlot5() Q_DECL_OVERRIDE Q_DECL_FINAL volatile {} - void pureSlot6() Q_DECL_OVERRIDE const volatile Q_DECL_FINAL {} - void pureSlot7() volatile Q_DECL_OVERRIDE Q_DECL_FINAL const {} - void pureSlot8() const Q_DECL_FINAL Q_DECL_OVERRIDE volatile {} - void pureSlot9() Q_DECL_FINAL volatile const Q_DECL_OVERRIDE {} + void pureSlot4() volatile Q_DECL_FINAL override {} + void pureSlot5() override Q_DECL_FINAL volatile {} + void pureSlot6() override const volatile Q_DECL_FINAL {} + void pureSlot7() volatile override Q_DECL_FINAL const {} + void pureSlot8() const Q_DECL_FINAL override volatile {} + void pureSlot9() Q_DECL_FINAL volatile const override {} #endif }; diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 4441337f6e..7a7cfb5704 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -147,7 +147,7 @@ public: bool done() const { return !m_timerId; } protected: - void timerEvent(QTimerEvent *te) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *te) override; private: int m_key; diff --git a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp index 44b7894c53..00d640e55e 100644 --- a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp +++ b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp @@ -255,10 +255,10 @@ class QTestTranslator : public QTranslator public: explicit QTestTranslator(QString str) : m_str(qMove(str)) {} - QString translate(const char *, const char *sourceText, const char *, int) const Q_DECL_OVERRIDE + QString translate(const char *, const char *sourceText, const char *, int) const override { return m_str + sourceText + m_str; } - bool isEmpty() const Q_DECL_OVERRIDE { return false; } + bool isEmpty() const override { return false; } }; template diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 0f5277710c..97f3eb4a60 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -894,7 +894,7 @@ public: : QProxyStyle(key), horizontalSpacing(-1), verticalSpacing(-1) {} - virtual int pixelMetric(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE + virtual int pixelMetric(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const override { if (pm == QStyle::PM_LayoutHorizontalSpacing && horizontalSpacing >= 0) { return horizontalSpacing; diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index 1be17b552e..a3c6805c7e 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -3461,12 +3461,12 @@ void tst_QGraphicsWidget::QTBUG_45867_send_itemChildAddedChange_to_parent() { } - QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(); } + QRectF boundingRect() const override { return QRectF(); } - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE {} + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override {} protected: - QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE + QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override { if (change == QGraphicsItem::ItemChildAddedChange) ++m_itemChildAddedChangeNotificationsCount; diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index a63ca49cbb..0fbb909646 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -86,7 +86,7 @@ public: GeometriesTestView() : QTableView(), updateGeometriesCalled(false) {} bool updateGeometriesCalled; protected slots: - void updateGeometries() Q_DECL_OVERRIDE { updateGeometriesCalled = true; QTableView::updateGeometries(); } + void updateGeometries() override { updateGeometriesCalled = true; QTableView::updateGeometries(); } }; class tst_QAbstractItemView : public QObject @@ -1562,7 +1562,7 @@ public: QItemDelegate(parent) {} - void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE { + void setEditorData(QWidget *editor, const QModelIndex &index) const override { Q_UNUSED(index); static bool w = true; editor->setEnabled(w); @@ -2006,7 +2006,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model() { } - void setSelectionModel(QItemSelectionModel *model) Q_DECL_OVERRIDE + void setSelectionModel(QItemSelectionModel *model) override { m_deselectedMustBeEmpty = !selectionModel() || !model || selectionModel()->model() != model->model(); QListView::setSelectionModel(model); @@ -2016,7 +2016,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model() bool selectionChangedOk() const { return m_selectionChangedOk; } protected: - bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE + bool viewportEvent(QEvent *event) override { if (event->type() == QEvent::Paint) ++m_paintEventsCount; @@ -2024,7 +2024,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model() } void selectionChanged(const QItemSelection &selected, - const QItemSelection &deselected) Q_DECL_OVERRIDE + const QItemSelection &deselected) override { if (m_deselectedMustBeEmpty && !deselected.isEmpty()) m_selectionChangedOk = false; @@ -2147,7 +2147,7 @@ signals: void setSelectionCalled(const QRect &rect); protected: - void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) Q_DECL_OVERRIDE + void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) override { emit setSelectionCalled(rect); QListView::setSelection(rect, flags); diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index b13e7b2f33..fea41f64a3 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -1799,7 +1799,7 @@ class TestHeaderViewStyle : public QProxyStyle { public: TestHeaderViewStyle() : horizontalSectionSize(100) {} - int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE + int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override { if (metric == QStyle::PM_HeaderDefaultSectionSizeHorizontal) return horizontalSectionSize; diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index b25a423af6..e761ce2833 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -2514,7 +2514,7 @@ class TestTreeViewStyle : public QProxyStyle { public: TestTreeViewStyle() : indentation(20) {} - int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE + int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override { if (metric == QStyle::PM_TreeViewIndentation) return indentation; diff --git a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp index c3ebb838bb..bcf48c21df 100644 --- a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp +++ b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp @@ -84,7 +84,7 @@ public: { return m_receivedGestures.value(gestureType); } protected: - bool event(QEvent * event) Q_DECL_OVERRIDE; + bool event(QEvent * event) override; private: typedef QHash GestureTypeHash; diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp index 9d0c939d84..ff35b0cdb1 100644 --- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp @@ -1105,7 +1105,7 @@ public: int overrideCount; - bool event(QEvent *e) Q_DECL_OVERRIDE + bool event(QEvent *e) override { if (e->type() == QEvent::ShortcutOverride) overrideCount++; diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 096beedf63..0ec8c6d9b1 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -5878,7 +5878,7 @@ public: startTimer(1000); } - void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE + void timerEvent(QTimerEvent *) override { switch (state++) { case 0: @@ -5901,7 +5901,7 @@ public: return false; } - bool nativeEvent(const QByteArray &eventType, void *message, long *) Q_DECL_OVERRIDE + bool nativeEvent(const QByteArray &eventType, void *message, long *) override { if (isMapNotify(eventType, message)) gotExpectedMapNotify = true; @@ -5909,7 +5909,7 @@ public: } // QAbstractNativeEventFilter interface - bool nativeEventFilter(const QByteArray &eventType, void *message, long *) Q_DECL_OVERRIDE + bool nativeEventFilter(const QByteArray &eventType, void *message, long *) override { if (isMapNotify(eventType, message)) gotExpectedGlobalEvent = true; @@ -10407,7 +10407,7 @@ class KeyboardWidget : public QWidget { public: KeyboardWidget(QWidget* parent = 0) : QWidget(parent), m_eventCounter(0) {} - virtual void mousePressEvent(QMouseEvent* ev) Q_DECL_OVERRIDE { + virtual void mousePressEvent(QMouseEvent* ev) override { m_modifiers = ev->modifiers(); m_appModifiers = QApplication::keyboardModifiers(); ++m_eventCounter; diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp index 9dc513c115..6dabc06b6d 100644 --- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp @@ -223,7 +223,7 @@ public: , paintEventCount(0) {} - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE + void paintEvent(QPaintEvent *event) override { ++paintEventCount; QWidget::paintEvent(event); @@ -696,7 +696,7 @@ public: int resizeCount; protected: - void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE + void resizeEvent(QResizeEvent *) override { resizeCount++; } @@ -763,7 +763,7 @@ public: , moveCount(0) { } - void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE + void moveEvent(QMoveEvent *) override { moveCount++; } @@ -802,7 +802,7 @@ public: } protected: - bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE + bool eventFilter(QObject *o, QEvent *e) override { if (e->type() == filterEventType()) ++eventCount; diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index d5ef2fe94b..f9c6b4c966 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -736,7 +736,7 @@ public: , called(false) {} - void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE { + void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const override { called = true; return QProxyStyle::drawPrimitive(pe, opt, p, w); } @@ -784,62 +784,62 @@ public: invalidOptionsDetected(false) {} - void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE { + void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const override { checkStyleEnum(pe, opt); return QProxyStyle::drawPrimitive(pe, opt, p, w); } - void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE { + void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const override { checkStyleEnum(element, opt); return QProxyStyle::drawControl(element, opt, p, w); } - QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE { + QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget) const override { checkStyleEnum(subElement, option); return QProxyStyle::subElementRect(subElement, option, widget); } - void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const Q_DECL_OVERRIDE { + void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const override { checkStyleEnum(cc, opt); return QProxyStyle::drawComplexControl(cc, opt, p, widget); } - QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE { + QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const override { checkStyleEnum(cc, opt); return QProxyStyle::subControlRect(cc, opt, sc, widget); } - int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE { + int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override { checkStyleEnum(metric, option); return QProxyStyle::pixelMetric(metric, option, widget); } - QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const Q_DECL_OVERRIDE { + QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const override { checkStyleEnum(ct, opt); return QProxyStyle::sizeFromContents(ct, opt, contentsSize, w); } - int styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE { + int styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const override { checkStyleEnum(stylehint, opt); return QProxyStyle::styleHint(stylehint, opt, widget, returnData); } - QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const Q_DECL_OVERRIDE { + QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const override { checkStyleEnum(standardPixmap, opt); return QProxyStyle::standardPixmap(standardPixmap, opt, widget); } - QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE { + QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const override { checkStyleEnum(standardIcon, option); return QProxyStyle::standardIcon(standardIcon, option, widget); } - QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const Q_DECL_OVERRIDE { + QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override { checkStyle(QString::asprintf("QIcon::Mode(%i)", iconMode).toLatin1(), opt); return QProxyStyle::generatedIconPixmap(iconMode, pixmap, opt); } - int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE { + int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const override { checkStyle(QString::asprintf("QSizePolicy::ControlType(%i), QSizePolicy::ControlType(%i)", control1, control2).toLatin1(), option); return QProxyStyle::layoutSpacing(control1, control2, orientation, option, widget); } diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp index 6363d0c673..500ec2e1fa 100644 --- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp +++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp @@ -47,7 +47,7 @@ public: QList events; protected: - bool event(QEvent *ev) Q_DECL_OVERRIDE { + bool event(QEvent *ev) override { events.append(ev->type()); return QWidget::event(ev); } diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index da37a9a968..b0ec4a55f4 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -819,7 +819,7 @@ public: } protected: - void showEvent(QShowEvent *e) Q_DECL_OVERRIDE + void showEvent(QShowEvent *e) override { QVERIFY(m_subMenu->isVisible()); QVERIFY2(m_subMenu->x() > x(), @@ -828,7 +828,7 @@ protected: QMenu::showEvent(e); } - void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE + void timerEvent(QTimerEvent *e) override { if (e->timerId() == m_timerId) { switch (m_timerTick++) { @@ -1217,7 +1217,7 @@ public: setMouseTracking(true); } - bool event(QEvent *e) Q_DECL_OVERRIDE + bool event(QEvent *e) override { switch (e->type()) { case QEvent::MouseMove: @@ -1525,7 +1525,7 @@ void tst_QMenu::menuSize_Scrolling() ~TestMenu() {} private: - void showEvent(QShowEvent *e) Q_DECL_OVERRIDE + void showEvent(QShowEvent *e) override { QVERIFY(actions().length() == m_numItems); diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index e10c7591d5..7bb0de7e17 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -100,16 +100,16 @@ public: m_w(expectedWidth), m_h(expectedHeight), r(1.0f), g(0.0f), b(0.0f) { } - void initializeGL() Q_DECL_OVERRIDE { + void initializeGL() override { m_initCalled = true; initializeOpenGLFunctions(); } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { m_paintCalled = true; glClearColor(r, g, b, 1.0f); glClear(GL_COLOR_BUFFER_BIT); } - void resizeGL(int w, int h) Q_DECL_OVERRIDE { + void resizeGL(int w, int h) override { m_resizeCalled = true; m_resizeOk = w == m_w && h == m_h; } @@ -203,10 +203,10 @@ public: PainterWidget(QWidget *parent) : QOpenGLWidget(parent), m_clear(false) { } - void initializeGL() Q_DECL_OVERRIDE { + void initializeGL() override { initializeOpenGLFunctions(); } - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { QPainter p(this); QCOMPARE(p.device()->width(), width()); QCOMPARE(p.device()->height(), height()); @@ -322,7 +322,7 @@ public: void resetPaintCount() { m_count = 0; } protected: - void drawForeground(QPainter *, const QRectF &) Q_DECL_OVERRIDE; + void drawForeground(QPainter *, const QRectF &) override; int m_count; }; @@ -372,7 +372,7 @@ class PaintCountWidget : public QOpenGLWidget public: PaintCountWidget() : m_count(0) { } void reset() { m_count = 0; } - void paintGL() Q_DECL_OVERRIDE { ++m_count; } + void paintGL() override { ++m_count; } int m_count; }; @@ -393,7 +393,7 @@ void tst_QOpenGLWidget::requestUpdate() class FboCheckWidget : public QOpenGLWidget { public: - void paintGL() Q_DECL_OVERRIDE { + void paintGL() override { GLuint reportedDefaultFbo = QOpenGLContext::currentContext()->defaultFramebufferObject(); GLuint expectedDefaultFbo = defaultFramebufferObject(); QCOMPARE(reportedDefaultFbo, expectedDefaultFbo); diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp index 72e6ffdeb5..9050ad4486 100644 --- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp +++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp @@ -299,7 +299,7 @@ class TestSplitterStyle : public QProxyStyle { public: TestSplitterStyle() : handleWidth(5) {} - int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE + int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override { if (metric == QStyle::PM_SplitterWidth) return handleWidth; diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 55ef44f4e0..4e1d93dbbb 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -2622,7 +2622,7 @@ namespace { { } - void drawTextItem(const QPointF &, const QTextItem &textItem) Q_DECL_OVERRIDE + void drawTextItem(const QPointF &, const QTextItem &textItem) override { itemFonts.append(qMakePair(textItem.text(), textItem.font())); } diff --git a/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 30a7b82278..10928e3afc 100644 --- a/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -53,7 +53,7 @@ tst_QThreadPool::~tst_QThreadPool() class NoOpRunnable : public QRunnable { public: - void run() Q_DECL_OVERRIDE { + void run() override { } }; diff --git a/tests/manual/cocoa/menurama/mainwindow.h b/tests/manual/cocoa/menurama/mainwindow.h index a7afa770be..3ca90dad8f 100644 --- a/tests/manual/cocoa/menurama/mainwindow.h +++ b/tests/manual/cocoa/menurama/mainwindow.h @@ -44,7 +44,7 @@ public: ~MainWindow(); protected: - void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *) override; public slots: void enableStuffMenu(bool enable); diff --git a/tests/manual/highdpi/dragwidget.h b/tests/manual/highdpi/dragwidget.h index 2cb821d509..8b67b20410 100644 --- a/tests/manual/highdpi/dragwidget.h +++ b/tests/manual/highdpi/dragwidget.h @@ -43,15 +43,15 @@ public: DragWidget(QString text = QString(), QWidget *parent = 0); protected: - void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; - void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; - void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void dragMoveEvent(QDragMoveEvent * event) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; - void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + void dragEnterEvent(QDragEnterEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void dragMoveEvent(QDragMoveEvent * event) override; + void paintEvent(QPaintEvent *) override; + void timerEvent(QTimerEvent *event) override; + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; private: QPoint dragPos; QPoint dropPos; diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp index 445af82e09..4b9f49e9f0 100644 --- a/tests/manual/qscreen/main.cpp +++ b/tests/manual/qscreen/main.cpp @@ -73,12 +73,12 @@ public: } protected: - void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE { + void mouseMoveEvent(QMouseEvent *ev) override { m_cursorPos = ev->screenPos().toPoint(); updateText(); } - void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE { + void mousePressEvent(QMouseEvent *ev) override { m_cursorPos = ev->screenPos().toPoint(); qDebug() << "top level @" << m_cursorPos << ":" << QGuiApplication::topLevelAt(m_cursorPos); updateText(); @@ -150,7 +150,7 @@ public: QScreen *screenSubject() const { return m_watcher->screenSubject(); } protected: - bool event(QEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *event) override; void startMouseMonitor(); private: diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp index 1d00ea5db5..9d4b8d08bd 100644 --- a/tests/manual/touch/main.cpp +++ b/tests/manual/touch/main.cpp @@ -118,7 +118,7 @@ public: explicit PanGesture(const QWidget *w, const QPanGesture *source) : Gesture(w, source) , m_offset(source->offset()) {} - void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE + void draw(const QRectF &rect, QPainter &painter) const override { const QPointF hotSpot = drawHotSpot(rect, painter); painter.drawLine(hotSpot, hotSpot + m_offset); @@ -134,7 +134,7 @@ public: , m_horizontal(source->horizontalDirection()), m_vertical(source->verticalDirection()) , m_angle(source->swipeAngle()) {} - void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE; + void draw(const QRectF &rect, QPainter &painter) const override; private: QSwipeGesture::SwipeDirection m_horizontal; @@ -197,7 +197,7 @@ class EventFilter : public QObject { public: explicit EventFilter(const EventTypeVector &types, QObject *p) : QObject(p), m_types(types) {} - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; + bool eventFilter(QObject *, QEvent *) override; signals: void eventReceived(const QString &); @@ -292,8 +292,8 @@ signals: void logMessage(const QString &); protected: - bool event(QEvent *event) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *event) override; + void paintEvent(QPaintEvent *) override; private: void handleGestureEvent(QGestureEvent *gestureEvent); diff --git a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp index e8844f87fd..f2c5494ebc 100644 --- a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp +++ b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp @@ -36,7 +36,7 @@ public: setFlags(QGraphicsItem::ItemIsSelectable); } - void paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option*/, QWidget * /*widget*/) Q_DECL_OVERRIDE + void paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option*/, QWidget * /*widget*/) override { if (isSelected()) painter->fillRect(rect(), QColor(255, 0, 0)); @@ -55,7 +55,7 @@ public: connect(this, SIGNAL(rubberBandChanged(QRect, QPointF, QPointF)), this, SLOT(updateRubberbandInfo(QRect, QPointF, QPointF))); } protected: - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE + void mouseMoveEvent(QMouseEvent *event) override { QGraphicsView::mouseMoveEvent(event); -- cgit v1.2.3