summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2017-09-18 10:36:49 +0200
committerKevin Funk <kevin.funk@kdab.com>2017-09-19 11:53:42 +0000
commit47c92fbb0b588b443cead18a5aad5a2b5ad9e4d7 (patch)
tree330914ff8225867e19b9ed5e049813d9f1e5ec08 /tests/auto/widgets/widgets
parent93dd85141b35460a83dac86083581ba1c1975927 (diff)
Replace Q_DECL_OVERRIDE with override where possible
Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp8
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp16
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp2
5 files changed, 15 insertions, 15 deletions
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<QEvent::Type> 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()));
}