Skip to content

Commit

Permalink
Replace Q_DECL_OVERRIDE with override where possible
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ville Voutilainen <[email protected]>
Reviewed-by: Olivier Goffart (Woboq GmbH) <[email protected]>
  • Loading branch information
krf committed Sep 19, 2017
1 parent 93dd851 commit 47c92fb
Show file tree
Hide file tree
Showing 622 changed files with 4,914 additions and 4,914 deletions.
4 changes: 2 additions & 2 deletions examples/network/multistreamclient/chatconsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class ChatConsumer : public Consumer
public:
explicit ChatConsumer(QObject *parent = nullptr);

QWidget *widget() Q_DECL_OVERRIDE;
void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
QWidget *widget() override;
void readDatagram(const QByteArray &ba) override;

private slots:
void returnPressed();
Expand Down
6 changes: 3 additions & 3 deletions examples/network/multistreamclient/movieconsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class MovieConsumer : public Consumer
public:
explicit MovieConsumer(QObject *parent = nullptr);

QWidget *widget() Q_DECL_OVERRIDE;
void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
void serverDisconnected() Q_DECL_OVERRIDE;
QWidget *widget() override;
void readDatagram(const QByteArray &ba) override;
void serverDisconnected() override;

private:
QLabel *label;
Expand Down
6 changes: 3 additions & 3 deletions examples/network/multistreamclient/timeconsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class TimeConsumer : public Consumer
public:
explicit TimeConsumer(QObject *parent = nullptr);

QWidget *widget() Q_DECL_OVERRIDE;
void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
void serverDisconnected() Q_DECL_OVERRIDE;
QWidget *widget() override;
void readDatagram(const QByteArray &ba) override;
void serverDisconnected() override;

private slots:
void timerTick();
Expand Down
6 changes: 3 additions & 3 deletions examples/network/multistreamserver/chatprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class ChatProvider : public Provider
public:
explicit ChatProvider(QObject *parent = nullptr);

void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
void newConnection(QSctpSocket &client) Q_DECL_OVERRIDE;
void clientDisconnected(QSctpSocket &client) Q_DECL_OVERRIDE;
void readDatagram(QSctpSocket &from, const QByteArray &ba) override;
void newConnection(QSctpSocket &client) override;
void clientDisconnected(QSctpSocket &client) override;
};

#endif
2 changes: 1 addition & 1 deletion examples/network/multistreamserver/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Server : public QDialog
virtual ~Server();

public slots:
int exec() Q_DECL_OVERRIDE;
int exec() override;

private slots:
void newConnection();
Expand Down
2 changes: 1 addition & 1 deletion examples/network/multistreamserver/timeprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TimeProvider : public Provider
public:
explicit TimeProvider(QObject *parent = nullptr);

void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
void readDatagram(QSctpSocket &from, const QByteArray &ba) override;
};

#endif
2 changes: 1 addition & 1 deletion examples/opengl/computegles31/glwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class GLWindow : public QOpenGLWindow
void setBlurRadius(float blurRadius);

protected:
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent *e) override;
void setAnimating(bool animate);

private:
Expand Down
2 changes: 1 addition & 1 deletion examples/xml/dombookmarks/xbeltree.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class XbelTree : public QTreeWidget

protected:
#if !defined(QT_NO_CONTEXTMENU) && !defined(QT_NO_CLIPBOARD)
void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
void contextMenuEvent(QContextMenuEvent *event) override;
#endif

private slots:
Expand Down
4 changes: 2 additions & 2 deletions src/concurrent/qtconcurrentthreadengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Q_CONCURRENT_EXPORT ThreadEngineBase: public QRunnable
void startThreads();
void threadExit();
bool threadThrottleExit();
void run() Q_DECL_OVERRIDE;
void run() override;
virtual void asynchronousFinish() = 0;
#ifndef QT_NO_EXCEPTIONS
void handleException(const QException &exception);
Expand Down Expand Up @@ -173,7 +173,7 @@ class ThreadEngine : public virtual ThreadEngineBase
return future;
}

void asynchronousFinish() Q_DECL_OVERRIDE
void asynchronousFinish() override
{
finish();
futureInterfaceTyped()->reportFinished(result());
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/animation/qabstractanimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Q_SLOTS:

protected:
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *event) override;

virtual void updateCurrentTime(int currentTime) = 0;
virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
Expand Down
10 changes: 5 additions & 5 deletions src/corelib/animation/qabstractanimation_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class QDefaultAnimationDriver : public QAnimationDriver
Q_OBJECT
public:
QDefaultAnimationDriver(QUnifiedTimer *timer);
void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *e) override;

private Q_SLOTS:
void startTimer();
Expand Down Expand Up @@ -196,7 +196,7 @@ class Q_CORE_EXPORT QUnifiedTimer : public QObject
qint64 elapsed() const;

protected:
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *) override;

private Q_SLOTS:
void startTimers();
Expand Down Expand Up @@ -265,11 +265,11 @@ class QAnimationTimer : public QAbstractAnimationTimer
*/
static void updateAnimationTimer();

void restartAnimationTimer() Q_DECL_OVERRIDE;
void updateAnimationsTime(qint64 delta) Q_DECL_OVERRIDE;
void restartAnimationTimer() override;
void updateAnimationsTime(qint64 delta) override;

//useful for profiling/debugging
int runningAnimationCount() Q_DECL_OVERRIDE { return animations.count(); }
int runningAnimationCount() override { return animations.count(); }

private Q_SLOTS:
void startAnimations();
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/animation/qanimationgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation

protected:
QAnimationGroup(QAnimationGroupPrivate &dd, QObject *parent);
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *event) override;

private:
Q_DISABLE_COPY(QAnimationGroup)
Expand Down
10 changes: 5 additions & 5 deletions src/corelib/animation/qparallelanimationgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup
QParallelAnimationGroup(QObject *parent = Q_NULLPTR);
~QParallelAnimationGroup();

int duration() const Q_DECL_OVERRIDE;
int duration() const override;

protected:
QParallelAnimationGroup(QParallelAnimationGroupPrivate &dd, QObject *parent);
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *event) override;

void updateCurrentTime(int currentTime) Q_DECL_OVERRIDE;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
void updateDirection(QAbstractAnimation::Direction direction) Q_DECL_OVERRIDE;
void updateCurrentTime(int currentTime) override;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
void updateDirection(QAbstractAnimation::Direction direction) override;

private:
Q_DISABLE_COPY(QParallelAnimationGroup)
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/animation/qparallelanimationgroup_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class QParallelAnimationGroupPrivate : public QAnimationGroupPrivate
void connectUncontrolledAnimations();
void disconnectUncontrolledAnimations();

void animationRemoved(int index, QAbstractAnimation *) Q_DECL_OVERRIDE;
void animationRemoved(int index, QAbstractAnimation *) override;

// private slot
void _q_uncontrolledAnimationFinished();
Expand Down
6 changes: 3 additions & 3 deletions src/corelib/animation/qpauseanimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ class Q_CORE_EXPORT QPauseAnimation : public QAbstractAnimation
QPauseAnimation(int msecs, QObject *parent = Q_NULLPTR);
~QPauseAnimation();

int duration() const Q_DECL_OVERRIDE;
int duration() const override;
void setDuration(int msecs);

protected:
bool event(QEvent *e) Q_DECL_OVERRIDE;
void updateCurrentTime(int) Q_DECL_OVERRIDE;
bool event(QEvent *e) override;
void updateCurrentTime(int) override;

private:
Q_DISABLE_COPY(QPauseAnimation)
Expand Down
6 changes: 3 additions & 3 deletions src/corelib/animation/qpropertyanimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
void setPropertyName(const QByteArray &propertyName);

protected:
bool event(QEvent *event) Q_DECL_OVERRIDE;
void updateCurrentValue(const QVariant &value) Q_DECL_OVERRIDE;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
bool event(QEvent *event) override;
void updateCurrentValue(const QVariant &value) override;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;

private:
Q_DISABLE_COPY(QPropertyAnimation)
Expand Down
10 changes: 5 additions & 5 deletions src/corelib/animation/qsequentialanimationgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
QPauseAnimation *insertPause(int index, int msecs);

QAbstractAnimation *currentAnimation() const;
int duration() const Q_DECL_OVERRIDE;
int duration() const override;

Q_SIGNALS:
void currentAnimationChanged(QAbstractAnimation *current);

protected:
QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent);
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *event) override;

void updateCurrentTime(int) Q_DECL_OVERRIDE;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
void updateDirection(QAbstractAnimation::Direction direction) Q_DECL_OVERRIDE;
void updateCurrentTime(int) override;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
void updateDirection(QAbstractAnimation::Direction direction) override;

private:
Q_DISABLE_COPY(QSequentialAnimationGroup)
Expand Down
4 changes: 2 additions & 2 deletions src/corelib/animation/qsequentialanimationgroup_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class QSequentialAnimationGroupPrivate : public QAnimationGroupPrivate
void setCurrentAnimation(int index, bool intermediate = false);
void activateCurrentAnimation(bool intermediate = false);

void animationInsertedAt(int index) Q_DECL_OVERRIDE;
void animationRemoved(int index, QAbstractAnimation *anim) Q_DECL_OVERRIDE;
void animationInsertedAt(int index) override;
void animationRemoved(int index, QAbstractAnimation *anim) override;

bool atEnd() const;

Expand Down
8 changes: 4 additions & 4 deletions src/corelib/animation/qvariantanimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Q_CORE_EXPORT QVariantAnimation : public QAbstractAnimation

QVariant currentValue() const;

int duration() const Q_DECL_OVERRIDE;
int duration() const override;
void setDuration(int msecs);

QEasingCurve easingCurve() const;
Expand All @@ -95,10 +95,10 @@ class Q_CORE_EXPORT QVariantAnimation : public QAbstractAnimation

protected:
QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *event) override;

void updateCurrentTime(int) Q_DECL_OVERRIDE;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
void updateCurrentTime(int) override;
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;

virtual void updateCurrentValue(const QVariant &value);
virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const;
Expand Down
10 changes: 5 additions & 5 deletions src/corelib/codecs/qicucodec_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ class QIcuCodec : public QTextCodec
static QTextCodec *codecForNameUnlocked(const char *name);
static QTextCodec *codecForMibUnlocked(int mib);

QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
QString convertToUnicode(const char *, int, ConverterState *) const override;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;

QByteArray name() const Q_DECL_OVERRIDE;
QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
int mibEnum() const Q_DECL_OVERRIDE;
QByteArray name() const override;
QList<QByteArray> aliases() const override;
int mibEnum() const override;

private:
QIcuCodec(const char *name);
Expand Down
8 changes: 4 additions & 4 deletions src/corelib/codecs/qisciicodec_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class QIsciiCodec : public QTextCodec {

static QTextCodec *create(const char *name);

QByteArray name() const Q_DECL_OVERRIDE;
int mibEnum() const Q_DECL_OVERRIDE;
QByteArray name() const override;
int mibEnum() const override;

QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
QString convertToUnicode(const char *, int, ConverterState *) const override;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;

private:
int idx;
Expand Down
20 changes: 10 additions & 10 deletions src/corelib/codecs/qlatincodec_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ class QLatin1Codec : public QTextCodec
public:
~QLatin1Codec();

QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
QString convertToUnicode(const char *, int, ConverterState *) const override;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;

QByteArray name() const Q_DECL_OVERRIDE;
QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
int mibEnum() const Q_DECL_OVERRIDE;
QByteArray name() const override;
QList<QByteArray> aliases() const override;
int mibEnum() const override;
};


Expand All @@ -78,12 +78,12 @@ class QLatin15Codec: public QTextCodec
public:
~QLatin15Codec();

QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
QString convertToUnicode(const char *, int, ConverterState *) const override;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;

QByteArray name() const Q_DECL_OVERRIDE;
QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
int mibEnum() const Q_DECL_OVERRIDE;
QByteArray name() const override;
QList<QByteArray> aliases() const override;
int mibEnum() const override;
};

#endif // QT_NO_TEXTCODEC
Expand Down
8 changes: 4 additions & 4 deletions src/corelib/codecs/qtsciicodec_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class QTsciiCodec : public QTextCodec {
public:
~QTsciiCodec();

QByteArray name() const Q_DECL_OVERRIDE;
int mibEnum() const Q_DECL_OVERRIDE;
QByteArray name() const override;
int mibEnum() const override;

QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
QString convertToUnicode(const char *, int, ConverterState *) const override;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
};

#endif // QT_NO_CODECS
Expand Down
Loading

0 comments on commit 47c92fb

Please sign in to comment.