summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-11 13:05:27 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-13 21:03:31 +0200
commit2c698a6d07c1e8fb1cca417892c017f9591852c3 (patch)
tree9860cefbcdd1237b85dfabea95ff0060b7b950b6 /tests/auto
parent6a37ca39ec7cfc2f4392784fd31936526d55e941 (diff)
Fix compiler warnings about missing overrides
Change-Id: I52bf9fe45607f4a99cafa441bd78dfe5f7adb0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp2
-rw-r--r--tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp2
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp2
-rw-r--r--tests/auto/network/socket/qudpsocket/clientserver/main.cpp2
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp42
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp4
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp6
-rw-r--r--tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp76
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp50
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp6
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp12
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp6
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp4
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp17
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp4
-rw-r--r--tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp4
-rw-r--r--tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp9
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp3
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp33
23 files changed, 154 insertions, 140 deletions
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index a84825d1e6..29c1a4c9e0 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -2030,7 +2030,7 @@ int numThreadSafetyFailures;
class SettingsThread : public QThread
{
public:
- void run();
+ void run() override;
void start(int n) { param = n; QThread::start(); }
private:
diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
index bd7100adec..c992b487bc 100644
--- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
@@ -2155,7 +2155,7 @@ void tst_QDataStream::stream_atEnd()
class FakeBuffer : public QBuffer
{
protected:
- qint64 writeData(const char *c, qint64 i) { return m_lock ? 0 : QBuffer::writeData(c, i); }
+ qint64 writeData(const char *c, qint64 i) override { return m_lock ? 0 : QBuffer::writeData(c, i); }
public:
FakeBuffer(bool locked = false) : m_lock(locked) {}
void setLocked(bool locked) { m_lock = locked; }
diff --git a/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp b/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
index 0cbb744ade..f21b0680bc 100644
--- a/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
+++ b/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
@@ -35,7 +35,7 @@ struct MyApplication : public QGuiApplication
: QGuiApplication(argc, argv)
{}
- bool event(QEvent * event)
+ bool event(QEvent * event) override
{
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent* ev = static_cast<QFileOpenEvent *>(event);
diff --git a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
index 8172cd4f6f..705abf87e3 100644
--- a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
+++ b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
@@ -70,7 +70,7 @@ public:
}
protected:
- void timerEvent(QTimerEvent *event)
+ void timerEvent(QTimerEvent *event) override
{
static int n = 0;
switch (type) {
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index a4017047ea..fe95120656 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -98,12 +98,12 @@ public:
CustomEvent::EventType = QEvent::registerEventType();
}
- QGesture* create(QObject *)
+ QGesture* create(QObject *) override
{
return new CustomGesture;
}
- QGestureRecognizer::Result recognize(QGesture *state, QObject*, QEvent *event)
+ QGestureRecognizer::Result recognize(QGesture *state, QObject*, QEvent *event) override
{
if (event->type() == CustomEvent::EventType) {
QGestureRecognizer::Result result;
@@ -127,7 +127,7 @@ public:
return QGestureRecognizer::Ignore;
}
- void reset(QGesture *state)
+ void reset(QGesture *state) override
{
CustomGesture *g = static_cast<CustomGesture *>(state);
g->serial = 0;
@@ -146,12 +146,12 @@ public:
CustomEvent::EventType = QEvent::registerEventType();
}
- QGesture* create(QObject *)
+ QGesture* create(QObject *) override
{
return new CustomGesture;
}
- QGestureRecognizer::Result recognize(QGesture *state, QObject*, QEvent *event)
+ QGestureRecognizer::Result recognize(QGesture *state, QObject*, QEvent *event) override
{
if (event->type() == CustomEvent::EventType) {
QGestureRecognizer::Result result = QGestureRecognizer::ConsumeEventHint;
@@ -171,7 +171,7 @@ public:
return QGestureRecognizer::Ignore;
}
- void reset(QGesture *state)
+ void reset(QGesture *state) override
{
CustomGesture *g = static_cast<CustomGesture *>(state);
g->serial = 0;
@@ -226,7 +226,7 @@ public:
QSet<Qt::GestureType> ignoredGestures;
protected:
- bool event(QEvent *event)
+ bool event(QEvent *event) override
{
Events *eventsPtr = 0;
if (event->type() == QEvent::Gesture) {
@@ -720,17 +720,17 @@ public:
ignoredFinishedGestures.clear();
}
- QRectF boundingRect() const
+ QRectF boundingRect() const override
{
return size;
}
- void paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+ void paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) override
{
QColor color = InstanceColors[instanceNumber % (sizeof(InstanceColors)/sizeof(InstanceColors[0]))];
p->fillRect(boundingRect(), color);
}
- bool event(QEvent *event)
+ bool event(QEvent *event) override
{
Events *eventsPtr = 0;
if (event->type() == QEvent::Gesture) {
@@ -1483,7 +1483,7 @@ void tst_Gestures::autoCancelGestures()
public:
MockWidget(const char *name) : GestureWidget(name), badGestureEvents(0) { }
- bool event(QEvent *event)
+ bool event(QEvent *event) override
{
if (event->type() == QEvent::Gesture) {
QGestureEvent *ge = static_cast<QGestureEvent*>(event);
@@ -1538,7 +1538,8 @@ void tst_Gestures::autoCancelGestures2()
public:
MockItem(const char *name) : GestureItem(name), badGestureEvents(0) { }
- bool event(QEvent *event) {
+ bool event(QEvent *event) override
+ {
if (event->type() == QEvent::Gesture) {
QGestureEvent *ge = static_cast<QGestureEvent*>(event);
if (ge->gestures().count() != 1)
@@ -2029,7 +2030,8 @@ public:
enum PanType { Platform, Default, Custom };
PanRecognizer(int id) : m_id(id) {}
- QGesture *create(QObject *) {
+ QGesture *create(QObject *) override
+ {
switch(m_id) {
case Platform: return new WinNativePan();
case Default: return new Pan();
@@ -2037,7 +2039,7 @@ public:
}
}
- Result recognize(QGesture *, QObject *, QEvent *) { return QGestureRecognizer::Ignore; }
+ Result recognize(QGesture *, QObject *, QEvent *) override { return QGestureRecognizer::Ignore; }
const int m_id;
};
@@ -2087,12 +2089,14 @@ public:
ReuseCanceledGesturesRecognizer(Type type) : m_type(type) {}
- QGesture *create(QObject *) {
+ QGesture *create(QObject *) override
+ {
QGesture *g = new QGesture;
return g;
}
- Result recognize(QGesture *gesture, QObject *, QEvent *event) {
+ Result recognize(QGesture *gesture, QObject *, QEvent *event) override
+ {
QMouseEvent *me = static_cast<QMouseEvent *>(event);
Qt::MouseButton mouseButton(m_type == LmbType ? Qt::LeftButton : Qt::RightButton);
@@ -2127,7 +2131,8 @@ class ReuseCanceledGesturesWidget : public QGraphicsWidget
{
}
- bool event(QEvent *event) {
+ bool event(QEvent *event) override
+ {
if (event->type() == QEvent::Gesture) {
QGesture *gesture = static_cast<QGestureEvent*>(event)->gesture(m_gestureType);
if (gesture) {
@@ -2310,7 +2315,8 @@ class NoConsumeWidgetBug13501 :public QWidget
{
Q_OBJECT
protected:
- bool event(QEvent *e) {
+ bool event(QEvent *e) override
+ {
if(e->type() == QEvent::Gesture) {
return false;
}
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp
index d0510c4b98..44eaa2e46f 100644
--- a/tests/auto/other/languagechange/tst_languagechange.cpp
+++ b/tests/auto/other/languagechange/tst_languagechange.cpp
@@ -84,7 +84,7 @@ public:
TransformTranslator() : QTranslator() {}
TransformTranslator(QObject *parent) : QTranslator(parent) {}
QString translate(const char *context, const char *sourceText,
- const char *disambiguation = 0, int = -1) const
+ const char *disambiguation = 0, int = -1) const override
{
QByteArray total(context);
total.append("::");
@@ -108,7 +108,7 @@ public:
return res;
}
- virtual bool isEmpty() const { return false; }
+ virtual bool isEmpty() const override { return false; }
public:
mutable QSet<QByteArray> m_translations;
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 0242f8a36e..5c025c8c4e 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -54,19 +54,19 @@ public:
bool focusOutEventRecieved;
bool focusOutEventLostFocus;
protected:
- virtual void keyPressEvent( QKeyEvent *e )
+ virtual void keyPressEvent( QKeyEvent *e ) override
{
// qDebug( QString("keyPressEvent: %1").arg(e->key()) );
QLineEdit::keyPressEvent( e );
}
- void focusInEvent( QFocusEvent* e )
+ void focusInEvent( QFocusEvent* e ) override
{
QLineEdit::focusInEvent( e );
focusInEventReason = e->reason();
focusInEventGotFocus = e->gotFocus();
focusInEventRecieved = true;
}
- void focusOutEvent( QFocusEvent* e )
+ void focusOutEvent( QFocusEvent* e ) override
{
QLineEdit::focusOutEvent( e );
focusOutEventReason = e->reason();
diff --git a/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp b/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
index 01772b2d02..ab85e0e4e6 100644
--- a/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
+++ b/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
@@ -67,7 +67,7 @@ public:
: QPrintDialog(p)
{
}
- int exec() { return 0; }
+ int exec() override { return 0; }
void resetAllOptions()
{
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index db8d6cdd45..77b2c0251d 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -113,7 +113,7 @@ public:
void reset() { _count = 0; }
protected:
- bool eventFilter(QObject *watched, QEvent *event)
+ bool eventFilter(QObject *watched, QEvent *event) override
{
Q_UNUSED(watched);
if (event->type() == spied)
@@ -315,13 +315,13 @@ void tst_QGraphicsView::construction()
class TestItem : public QGraphicsItem
{
public:
- QRectF boundingRect() const
+ QRectF boundingRect() const override
{ return QRectF(-10, -10, 20, 20); }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{ hints = painter->renderHints(); painter->drawRect(boundingRect()); }
- bool sceneEvent(QEvent *event)
+ bool sceneEvent(QEvent *event) override
{
events << event->type();
return QGraphicsItem::sceneEvent(event);
@@ -1593,7 +1593,7 @@ public:
: QGraphicsRectItem(rect), numPaints(0)
{ }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override
{
++numPaints;
QGraphicsRectItem::paint(painter, option, widget);
@@ -2188,7 +2188,7 @@ class MouseWheelScene : public QGraphicsScene
public:
Qt::Orientation orientation;
- void wheelEvent(QGraphicsSceneWheelEvent *event)
+ void wheelEvent(QGraphicsSceneWheelEvent *event) override
{
orientation = event->orientation();
QGraphicsScene::wheelEvent(event);
@@ -2429,7 +2429,7 @@ public:
bool painted;
protected:
- void paintEvent(QPaintEvent *event)
+ void paintEvent(QPaintEvent *event) override
{
lastUpdateRegions << event->region();
painted = true;
@@ -2634,7 +2634,7 @@ public:
using QGraphicsRectItem::QGraphicsRectItem;
bool dirtyPainter = false;
bool receivedPaintEvent = false;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *w)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *w) override
{
receivedPaintEvent = true;
dirtyPainter = (painter->pen().color() != w->palette().color(w->foregroundRole()));
@@ -2648,12 +2648,14 @@ public:
MyGraphicsView(QGraphicsScene * scene) : QGraphicsView(scene)
{ }
- void drawBackground(QPainter * painter, const QRectF & rect) {
+ void drawBackground(QPainter * painter, const QRectF & rect) override
+ {
painter->setCompositionMode(QPainter::CompositionMode_Source);
painter->drawRect(rect);
}
- void drawItems (QPainter * painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[]) {
+ void drawItems (QPainter * painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[]) override
+ {
if (!(optimizationFlags() & QGraphicsView::DontSavePainterState))
QCOMPARE(painter->compositionMode(),QPainter::CompositionMode_SourceOver);
else
@@ -2721,10 +2723,10 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState2()
class MyScene : public QGraphicsScene
{
public:
- void drawBackground(QPainter *p, const QRectF &)
+ void drawBackground(QPainter *p, const QRectF &) override
{ transformInDrawBackground = p->worldTransform(); opacityInDrawBackground = p->opacity(); }
- void drawForeground(QPainter *p, const QRectF &)
+ void drawForeground(QPainter *p, const QRectF &) override
{ transformInDrawForeground = p->worldTransform(); opacityInDrawForeground = p->opacity(); }
QTransform transformInDrawBackground;
@@ -2800,7 +2802,7 @@ public:
LodItem(const QRectF &rect) : QGraphicsRectItem(rect), lastLod(-42)
{ }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *viewport)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *viewport) override
{
lastLod = option->levelOfDetailFromTransform(painter->worldTransform());
QGraphicsRectItem::paint(painter, option, viewport);
@@ -2863,14 +2865,15 @@ void tst_QGraphicsView::scrollBarRanges_data()
// Simulates motif scrollbar for range tests
class FauxMotifStyle : public QCommonStyle {
public:
- int styleHint(StyleHint hint, const QStyleOption *option,
- const QWidget *widget, QStyleHintReturn *returnData) const {
+ int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const override
+ {
if (hint == QStyle::SH_ScrollView_FrameOnlyAroundContents)
return true;
return QCommonStyle::styleHint(hint, option, widget, returnData);
}
- int pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *widget) const {
+ int pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *widget) const override
+ {
if (m == QStyle::PM_ScrollView_ScrollBarSpacing)
return 4;
return QCommonStyle::pixelMetric(m, opt, widget);
@@ -2959,12 +2962,12 @@ public:
bool doubleClickAccepted;
protected:
- void mousePressEvent(QMouseEvent *event)
+ void mousePressEvent(QMouseEvent *event) override
{
QGraphicsView::mousePressEvent(event);
pressAccepted = event->isAccepted();
}
- void mouseDoubleClickEvent(QMouseEvent *event)
+ void mouseDoubleClickEvent(QMouseEvent *event) override
{
QGraphicsView::mouseDoubleClickEvent(event);
doubleClickAccepted = event->isAccepted();
@@ -3020,12 +3023,12 @@ public:
bool doubleClickForwarded;
protected:
- void mousePressEvent(QMouseEvent *event)
+ void mousePressEvent(QMouseEvent *event) override
{
QWidget::mousePressEvent(event);
pressForwarded = true;
}
- void mouseDoubleClickEvent(QMouseEvent *event)
+ void mouseDoubleClickEvent(QMouseEvent *event) override
{
QWidget::mouseDoubleClickEvent(event);
doubleClickForwarded = true;
@@ -3152,7 +3155,7 @@ public:
QGraphicsTextItem_task172231(const QString & text, QGraphicsItem * parent = 0)
: QGraphicsTextItem(text, parent) {}
QRectF exposedRect;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
exposedRect = option->exposedRect;
QGraphicsTextItem::paint(painter, option, widget);
@@ -3202,9 +3205,9 @@ public:
int releases;
protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event)
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override
{ ++presses; QGraphicsScene::mousePressEvent(event); }
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
{ ++releases; QGraphicsScene::mouseReleaseEvent(event); }
};
@@ -3257,7 +3260,7 @@ public:
{ }
int mouseMoves;
protected:
- void mouseMoveEvent(QMouseEvent *event)
+ void mouseMoveEvent(QMouseEvent *event) override
{
++mouseMoves;
QGraphicsView::mouseMoveEvent(event);
@@ -3310,7 +3313,7 @@ void tst_QGraphicsView::task207546_focusCrash()
class _Widget : public QWidget
{
public:
- bool focusNextPrevChild(bool next) { return QWidget::focusNextPrevChild(next); }
+ bool focusNextPrevChild(bool next) override { return QWidget::focusNextPrevChild(next); }
} widget;
widget.setLayout(new QVBoxLayout());
@@ -3487,7 +3490,7 @@ public:
{
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
transform = painter->transform();
}
@@ -3612,7 +3615,7 @@ void tst_QGraphicsView::moveItemWhileScrolling()
}
protected:
QEventLoop eventLoop;
- void paintEvent(QPaintEvent *event)
+ void paintEvent(QPaintEvent *event) override
{
painted = true;
lastPaintedRegion = event->region();
@@ -3918,8 +3921,7 @@ public:
: QGraphicsRectItem(rect), paints(0)
{ }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
- QWidget *widget)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
QGraphicsRectItem::paint(painter, option, widget);
++paints;
@@ -4306,7 +4308,7 @@ public:
m_viewHasIMEnabledInFocusInEvent = false;
}
- void focusInEvent(QFocusEvent * /* event */)
+ void focusInEvent(QFocusEvent * /* event */) override
{
QGraphicsView *view = scene()->views().first();
m_viewHasIMEnabledInFocusInEvent = view->testAttribute(Qt::WA_InputMethodEnabled);
@@ -4470,7 +4472,7 @@ void tst_QGraphicsView::indirectPainting()
class MyScene : public QGraphicsScene
{ public:
MyScene() : QGraphicsScene(), drawCount(0) {}
- void drawItems(QPainter *, int, QGraphicsItem **, const QStyleOptionGraphicsItem *, QWidget *)
+ void drawItems(QPainter *, int, QGraphicsItem **, const QStyleOptionGraphicsItem *, QWidget *) override
{ ++drawCount; }
int drawCount;
};
@@ -4498,7 +4500,7 @@ void tst_QGraphicsView::compositionModeInDrawBackground()
painted(false), compositionMode(QPainter::CompositionMode_SourceOver) {}
bool painted;
QPainter::CompositionMode compositionMode;
- void drawBackground(QPainter *painter, const QRectF &)
+ void drawBackground(QPainter *painter, const QRectF &) override
{
compositionMode = painter->compositionMode();
painted = true;
@@ -4624,7 +4626,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts()
QRegion updateRegion;
bool itSTimeToTest;
- void paintEvent(QPaintEvent *event)
+ void paintEvent(QPaintEvent *event) override
{
QGraphicsView::paintEvent(event);
@@ -4713,7 +4715,7 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect()
{
public:
CustomScene(const QRectF &rect) : QGraphicsScene(rect) { }
- void drawBackground(QPainter * /* painter */, const QRectF &rect)
+ void drawBackground(QPainter * /* painter */, const QRectF &rect) override
{ lastBackgroundExposedRect = rect; }
QRectF lastBackgroundExposedRect;
};
@@ -4723,7 +4725,7 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect()
public:
CustomRectItem(const QRectF &rect) : QGraphicsRectItem(rect)
{ setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); }
- void paint(QPainter * /* painter */, const QStyleOptionGraphicsItem *option, QWidget * /* widget */ = 0)
+ void paint(QPainter * /* painter */, const QStyleOptionGraphicsItem *option, QWidget * /* widget */ = 0) override
{ lastExposedRect = option->exposedRect; }
QRectF lastExposedRect;
};
@@ -4778,7 +4780,7 @@ public:
setAcceptHoverEvents(true);
}
- bool sceneEvent(QEvent *event)
+ bool sceneEvent(QEvent *event) override
{
if (!checkEvents) // ensures that we don't look at stray events before we are ready
return QGraphicsRectItem::sceneEvent(event);
@@ -4840,7 +4842,7 @@ public:
setFlag(QGraphicsItem::ItemAcceptsInputMethod, true);
}
- QVariant inputMethodQuery(Qt::InputMethodQuery) const
+ QVariant inputMethodQuery(Qt::InputMethodQuery) const override
{
return mf;
}
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index da010ac357..2ceba99d91 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -175,26 +175,26 @@ class MyAbstractItemDelegate : public QAbstractItemDelegate
{
public:
MyAbstractItemDelegate() : QAbstractItemDelegate() {};
- void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const {}
- QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(); }
+ void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override {}
+ QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override { return QSize(); }
};
class MyAbstractItemModel: public QAbstractItemModel
{
public:
MyAbstractItemModel() : QAbstractItemModel() {};
- QModelIndex index(int, int, const QModelIndex &) const { return QModelIndex(); }
- QModelIndex parent(const QModelIndex &) const { return QModelIndex(); }
- int rowCount(const QModelIndex &) const { return 0; }
- int columnCount(const QModelIndex &) const { return 0; }
- bool hasChildren(const QModelIndex &) const { return false; }
- QVariant data(const QModelIndex &, int) const { return QVariant(); }
- bool setData(const QModelIndex &, const QVariant &, int) { return false; }
- bool insertRows(int, int, const QModelIndex &) { return false; }
- bool insertColumns(int, int, const QModelIndex &) { return false; }
+ QModelIndex index(int, int, const QModelIndex &) const override { return QModelIndex(); }
+ QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); }
+ int rowCount(const QModelIndex &) const override { return 0; }
+ int columnCount(const QModelIndex &) const override { return 0; }
+ bool hasChildren(const QModelIndex &) const override { return false; }
+ QVariant data(const QModelIndex &, int) const override { return QVariant(); }
+ bool setData(const QModelIndex &, const QVariant &, int) override { return false; }
+ bool insertRows(int, int, const QModelIndex &) override { return false; }
+ bool insertColumns(int, int, const QModelIndex &) override { return false; }
void setPersistent(const QModelIndex &, const QModelIndex &) {}
- bool removeRows (int, int, const QModelIndex &) { return false; }
- bool removeColumns(int, int, const QModelIndex &) { return false; }
+ bool removeRows (int, int, const QModelIndex &) override { return false; }
+ bool removeColumns(int, int, const QModelIndex &) override { return false; }
void reset() {}
};
@@ -202,16 +202,16 @@ class MyAbstractItemView : public QAbstractItemView
{
public:
MyAbstractItemView() : QAbstractItemView() {}
- QRect visualRect(const QModelIndex &) const { return QRect(); }
- void scrollTo(const QModelIndex &, ScrollHint) {}
- QModelIndex indexAt(const QPoint &) const { return QModelIndex(); }
+ QRect visualRect(const QModelIndex &) const override { return QRect(); }
+ void scrollTo(const QModelIndex &, ScrollHint) override {}
+ QModelIndex indexAt(const QPoint &) const override { return QModelIndex(); }
protected:
- QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) { return QModelIndex(); }
- int horizontalOffset() const { return 0; }
- int verticalOffset() const { return 0; }
- bool isIndexHidden(const QModelIndex &) const { return false; }
- void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) {}
- QRegion visualRegionForSelection(const QItemSelection &) const { return QRegion(); }
+ QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override { return QModelIndex(); }
+ int horizontalOffset() const override { return 0; }
+ int verticalOffset() const override { return 0; }
+ bool isIndexHidden(const QModelIndex &) const override { return false; }
+ void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) override {}
+ QRegion visualRegionForSelection(const QItemSelection &) const override { return QRegion(); }
};
void tst_QComboBox::initTestCase()
@@ -1831,7 +1831,7 @@ public:
box->setGeometry(rect());
}
- void keyPressEvent(QKeyEvent *e)
+ void keyPressEvent(QKeyEvent *e) override
{
received = (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter);
}
@@ -2666,13 +2666,13 @@ void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
public:
TestStyle() : QProxyStyle(QStyleFactory::create("windows")) { }
- int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *ret) const
+ int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *ret) const override
{
if (hint == SH_ComboBox_Popup) return 1;
else return QCommonStyle::styleHint(hint, option, widget, ret);
}
- void drawControl(ControlElement element, const QStyleOption *option, QPainter *, const QWidget *) const
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *, const QWidget *) const override
{
if (element == CE_MenuItem)
discoveredRect = option->rect;
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index 55be152e40..84a4f9e5a0 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -864,18 +864,18 @@ void tst_QDockWidget::task169808_setFloating()
class MyWidget : public QWidget
{
public:
- QSize sizeHint() const
+ QSize sizeHint() const override
{
const QRect& deskRect = QGuiApplication::primaryScreen()->availableGeometry();
return QSize(qMin(300, deskRect.width() / 2), qMin(300, deskRect.height() / 2));
}
- QSize minimumSizeHint() const
+ QSize minimumSizeHint() const override
{
return QSize(20,20);
}
- void paintEvent(QPaintEvent *)
+ void paintEvent(QPaintEvent *) override
{
QPainter p(this);
p.fillRect(rect(), Qt::red);
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
index cec2da1d57..67813bdeac 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -52,25 +52,25 @@ public:
DoubleSpinBox(QWidget *parent = 0)
: QDoubleSpinBox(parent)
{ /*connect(this, SIGNAL(valueChanged(double)), this, SLOT(foo(double)));*/ }
- QString textFromValue(double v) const
+ QString textFromValue(double v) const override
{
return QDoubleSpinBox::textFromValue(v);
}
- QValidator::State validate(QString &text, int &pos) const
+ QValidator::State validate(QString &text, int &pos) const override
{
return QDoubleSpinBox::validate(text, pos);
}
- double valueFromText(const QString &text) const
+ double valueFromText(const QString &text) const override
{
return QDoubleSpinBox::valueFromText(text);
}
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *event)
+ void wheelEvent(QWheelEvent *event) override
{
QDoubleSpinBox::wheelEvent(event);
}
#endif
- void initStyleOption(QStyleOptionSpinBox *option) const
+ void initStyleOption(QStyleOptionSpinBox *option) const override
{
QDoubleSpinBox::initStyleOption(option);
}
@@ -1172,7 +1172,7 @@ void tst_QDoubleSpinBox::taskQTBUG_5008_textFromValueAndValidate()
}
//we use the French delimiters here
- QString textFromValue (double value) const
+ QString textFromValue (double value) const override
{
return locale().toString(value);
}
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 15890bfd9c..b0fc8a3bfa 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -65,7 +65,7 @@ public:
{
m_timerId = startTimer(200);
}
- void timerEvent(QTimerEvent*)
+ void timerEvent(QTimerEvent*) override
{
QCoreApplication::postEvent(m_tb, new QMouseEvent(QEvent::MouseButtonPress, QPoint(6, 7), Qt::LeftButton, {}, {}));
QCoreApplication::postEvent(m_tb, new QMouseEvent(QEvent::MouseMove, QPoint(7, 8), Qt::LeftButton, Qt::LeftButton, {}));
@@ -89,7 +89,7 @@ public:
m_timerId = startTimer(100);
}
- void timerEvent(QTimerEvent*)
+ void timerEvent(QTimerEvent*) override
{
QCoreApplication::postEvent(m_w, new QMouseEvent(QEvent::MouseButtonPress, QPoint(230, 370), Qt::LeftButton, {}, {}));
QCoreApplication::postEvent(m_w, new QMouseEvent(QEvent::MouseButtonRelease, QPoint(230, 370), Qt::LeftButton, {}, {}));
@@ -1468,7 +1468,7 @@ public:
{
}
- QSize sizeHint() const
+ QSize sizeHint() const override
{
return QSize(200, 200);
}
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index 0b6d161890..a18fd0299a 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -705,7 +705,7 @@ public:
{
}
- void paintEvent(QPaintEvent *)
+ void paintEvent(QPaintEvent *) override
{
QPainter p(this);
text.setText(QStringLiteral("test"));
diff --git a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
index 9f08bd337b..c14b3aa9d8 100644
--- a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
@@ -85,7 +85,7 @@ public:
setBackgroundRole(QPalette::Dark);
}
protected:
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
{
if (query == Qt::ImCursorRectangle)
return QRect(width() / 2, height() / 2, 5, 5);
@@ -120,7 +120,7 @@ class HFWWidget : public QWidget
{
public:
HFWWidget();
- int heightForWidth(int w) const;
+ int heightForWidth(int w) const override;
};
HFWWidget::HFWWidget()
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index 2452bc34c5..92771db764 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
@@ -101,8 +101,8 @@ void tst_QScrollBar::task_209492()
int scrollCount;
MyScrollArea(QWidget *parent = 0) : QScrollArea(parent), scrollCount(0) {}
protected:
- void paintEvent(QPaintEvent *) { QTest::qSleep(600); }
- void scrollContentsBy(int, int) { ++scrollCount; viewport()->update(); }
+ void paintEvent(QPaintEvent *) override { QTest::qSleep(600); }
+ void scrollContentsBy(int, int) override { ++scrollCount; viewport()->update(); }
};
MyScrollArea scrollArea;
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 9f109ab96c..e9c4d3b0d6 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -64,25 +64,25 @@ public:
SpinBox(QWidget *parent = 0)
: QSpinBox(parent)
{}
- QString textFromValue(int v) const
+ QString textFromValue(int v) const override
{
return QSpinBox::textFromValue(v);
}
- QValidator::State validate(QString &text, int &pos) const
+ QValidator::State validate(QString &text, int &pos) const override
{
return QSpinBox::validate(text, pos);
}
- int valueFromText(const QString &text) const
+ int valueFromText(const QString &text) const override
{
return QSpinBox::valueFromText(text);
}
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *event)
+ void wheelEvent(QWheelEvent *event) override
{
QSpinBox::wheelEvent(event);
}
#endif
- void initStyleOption(QStyleOptionSpinBox *option) const
+ void initStyleOption(QStyleOptionSpinBox *option) const override
{
QSpinBox::initStyleOption(option);
}
@@ -510,7 +510,8 @@ class ReadOnlyChangeTracker: public QSpinBox
public:
ReadOnlyChangeTracker(QWidget *parent = 0) : QSpinBox(parent) {}
- void changeEvent(QEvent *ev) {
+ void changeEvent(QEvent *ev) override
+ {
if (ev->type() == QEvent::ReadOnlyChange)
++readOnlyChangeEventCount;
}
@@ -1138,7 +1139,7 @@ void tst_QSpinBox::textFromValue()
class sizeHint_SpinBox : public QSpinBox
{
public:
- QSize sizeHint() const
+ QSize sizeHint() const override
{
++sizeHintRequests;
return QSpinBox::sizeHint();
@@ -1198,7 +1199,7 @@ void tst_QSpinBox::taskQTBUG_5008_textFromValueAndValidate()
}
//we use the French delimiters here
- QString textFromValue (int value) const
+ QString textFromValue (int value) const override
{
return locale().toString(value);
}
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index aca795ff61..b63e917e5c 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -952,11 +952,11 @@ class MyTextEdit : public QTextEdit
{
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
}
- virtual QSize minimumSizeHint () const
+ virtual QSize minimumSizeHint () const override
{
return QSize(200, 200) * m_iFactor;
}
- virtual QSize sizeHint() const
+ virtual QSize sizeHint() const override
{
return QSize(390, 390) * m_iFactor;
}
diff --git a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp
index 4fd3661fa7..479c8a463d 100644
--- a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp
+++ b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp
@@ -128,13 +128,13 @@ public:
createWidgets();
}
- virtual void showEvent (QShowEvent *)
+ virtual void showEvent (QShowEvent *) override
{
if (!m_staticWidgets)
createWidgets();
}
- virtual void hideEvent (QHideEvent *)
+ virtual void hideEvent (QHideEvent *) override
{
if (!m_staticWidgets)
destroyWidgets();
diff --git a/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp b/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
index 502535502d..2afbd44c03 100644
--- a/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
@@ -702,7 +702,7 @@ public:
Widget10052(QWidget *parent) : QWidget(parent), moved(false)
{ }
- void moveEvent(QMoveEvent *e)
+ void moveEvent(QMoveEvent *e) override
{
moved = e->oldPos() != e->pos();
QWidget::moveEvent(e);
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index 25f61ec7ac..4bbd44283d 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -60,10 +60,12 @@ class QTabWidgetChild:public QTabWidget {
};
protected:
- virtual void tabInserted(int /*index */ ) {
+ virtual void tabInserted(int /*index */ ) override
+ {
tabCount++;
};
- virtual void tabRemoved(int /*index */ ) {
+ virtual void tabRemoved(int /*index */ ) override
+ {
tabCount--;
};
int tabCount;
@@ -553,7 +555,8 @@ public:
PaintCounter() :count(0) { setAttribute(Qt::WA_OpaquePaintEvent); }
int count;
protected:
- void paintEvent(QPaintEvent*) {
+ void paintEvent(QPaintEvent*) override
+ {
++count;
}
};
diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
index 7e99177dec..f562f84037 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
@@ -483,7 +483,8 @@ void tst_QTextBrowser::anchorsWithSelfBuiltHtml()
class HelpBrowser : public QTextBrowser
{
public:
- virtual QVariant loadResource(int /*type*/, const QUrl &name) {
+ virtual QVariant loadResource(int /*type*/, const QUrl &name) override
+ {
QString url = name.toString();
if(url == "qhelp://docs/index.html") {
return "index";
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index eaa7251684..4054e35e8d 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -334,18 +334,18 @@ public:
inline QtTestDocumentLayout(QTextEdit *edit, QTextDocument *doc, int &itCount)
: QAbstractTextDocumentLayout(doc), useBiggerSize(false), ed(edit), iterationCounter(itCount) {}
- virtual void draw(QPainter *, const QAbstractTextDocumentLayout::PaintContext &) {}
+ virtual void draw(QPainter *, const QAbstractTextDocumentLayout::PaintContext &) override {}
- virtual int hitTest(const QPointF &, Qt::HitTestAccuracy ) const { return 0; }
+ virtual int hitTest(const QPointF &, Qt::HitTestAccuracy ) const override { return 0; }
- virtual void documentChanged(int, int, int) {}
+ virtual void documentChanged(int, int, int) override {}
- virtual int pageCount() const { return 1; }
+ virtual int pageCount() const override { return 1; }
- virtual QSizeF documentSize() const { return usedSize; }
+ virtual QSizeF documentSize() const override { return usedSize; }
- virtual QRectF frameBoundingRect(QTextFrame *) const { return QRectF(); }
- virtual QRectF blockBoundingRect(const QTextBlock &) const { return QRectF(); }
+ virtual QRectF frameBoundingRect(QTextFrame *) const override { return QRectF(); }
+ virtual QRectF blockBoundingRect(const QTextBlock &) const override { return QRectF(); }
bool useBiggerSize;
QSize usedSize;
@@ -1444,15 +1444,15 @@ public:
mutable int canInsertCallCount;
mutable int insertCallCount;
- virtual QMimeData *createMimeDataFromSelection() const {
+ virtual QMimeData *createMimeDataFromSelection() const override {
createMimeDataCallCount++;
return QTextEdit::createMimeDataFromSelection();
}
- virtual bool canInsertFromMimeData(const QMimeData *source) const {
+ virtual bool canInsertFromMimeData(const QMimeData *source) const override {
canInsertCallCount++;
return QTextEdit::canInsertFromMimeData(source);
}
- virtual void insertFromMimeData(const QMimeData *source) {
+ virtual void insertFromMimeData(const QMimeData *source) override {
insertCallCount++;
QTextEdit::insertFromMimeData(source);
}
@@ -1604,7 +1604,7 @@ public:
bool resizeEventCalled;
protected:
- virtual void resizeEvent(QResizeEvent *e)
+ virtual void resizeEvent(QResizeEvent *e) override
{
QTextEdit::resizeEvent(e);
setHtml("<img src=qtextbrowser-resizeevent.png width=" + QString::number(size().width()) + "><br>Size is " + QString::number(size().width()) + " x " + QString::number(size().height()));
@@ -2005,7 +2005,8 @@ void tst_QTextEdit::fullWidthSelection()
// enable full-width-selection for our test widget.
class FullWidthStyle : public QCommonStyle {
- int styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const {
+ int styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const override
+ {
if (stylehint == QStyle::SH_RichText_FullWidthSelection)
return 1;
return QCommonStyle::styleHint(stylehint, opt, widget, returnData);
@@ -2565,7 +2566,7 @@ void tst_QTextEdit::highlightLongLine()
class NumHighlighter : public QSyntaxHighlighter {
public:
explicit NumHighlighter(QTextDocument*doc) : QSyntaxHighlighter(doc) {};
- virtual void highlightBlock(const QString& text) {
+ virtual void highlightBlock(const QString& text) override {
// odd number in bold
QTextCharFormat format;
format.setFontWeight(QFont::Bold);
@@ -2644,7 +2645,7 @@ public:
TextEdit(QWidget *parent = 0)
: QTextEdit(parent)
{}
- void wheelEvent(QWheelEvent *event)
+ void wheelEvent(QWheelEvent *event) override
{
QTextEdit::wheelEvent(event);
}
@@ -2703,12 +2704,12 @@ namespace {
}
- QPaintEngine *paintEngine () const
+ QPaintEngine *paintEngine () const override
{
return m_paintEngine;
}
- int metric (QPaintDevice::PaintDeviceMetric metric) const {
+ int metric (QPaintDevice::PaintDeviceMetric metric) const override {
switch (metric) {
case QPaintDevice::PdmWidth:
case QPaintDevice::PdmHeight: