aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-03-25 14:44:04 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-04-01 10:14:16 +0200
commit4a77e2593f281456d25c9b2dd5df400c3e588e4c (patch)
treea21a70166688d1a76f31bace9265e95c700cee05 /tests/auto/quick/qquickwindow
parentda68a8431a2cc0fdea7482750ad4e1abf3f7a85d (diff)
Mark overrides in tests, fix compiler warnings
Change-Id: If753558d911e50a73e351a93eed2e4df3e6592c7 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickwindow')
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp42
1 files changed, 27 insertions, 15 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 05fda64654..1a04d317ce 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -211,7 +211,8 @@ public:
QPointF lastMousePos;
QInputDevice::Capabilities lastMouseCapabilityFlags;
- void touchEvent(QTouchEvent *event) {
+ void touchEvent(QTouchEvent *event) override
+ {
if (!acceptTouchEvents) {
event->ignore();
return;
@@ -229,7 +230,8 @@ public:
}
}
- void mousePressEvent(QMouseEvent *e) {
+ void mousePressEvent(QMouseEvent *e) override
+ {
if (!acceptMouseEvents) {
e->ignore();
return;
@@ -239,7 +241,8 @@ public:
lastMouseCapabilityFlags = e->device()->capabilities();
}
- void mouseMoveEvent(QMouseEvent *e) {
+ void mouseMoveEvent(QMouseEvent *e) override
+ {
if (!acceptMouseEvents) {
e->ignore();
return;
@@ -250,7 +253,8 @@ public:
lastMousePos = e->position().toPoint();
}
- void mouseReleaseEvent(QMouseEvent *e) {
+ void mouseReleaseEvent(QMouseEvent *e) override
+ {
if (!acceptMouseEvents) {
e->ignore();
return;
@@ -260,12 +264,14 @@ public:
lastMouseCapabilityFlags = e->device()->capabilities();
}
- void mouseUngrabEvent() {
+ void mouseUngrabEvent() override
+ {
qCDebug(lcTests) << objectName();
++mouseUngrabEventCount;
}
- bool childMouseEventFilter(QQuickItem *item, QEvent *e) {
+ bool childMouseEventFilter(QQuickItem *item, QEvent *e) override
+ {
qCDebug(lcTests) << objectName() << "filtering" << e << "ahead of delivery to" << item->metaObject()->className() << item->objectName();
switch (e->type()) {
case QEvent::MouseButtonPress:
@@ -295,7 +301,8 @@ int TestTouchItem::mouseReleaseNum = 0;
class EventFilter : public QObject
{
public:
- bool eventFilter(QObject *watched, QEvent *event) {
+ bool eventFilter(QObject *watched, QEvent *event) override
+ {
Q_UNUSED(watched);
events.append(event->type());
return false;
@@ -312,7 +319,8 @@ public:
int iterations;
protected:
- QSGNode* updatePaintNode(QSGNode *, UpdatePaintNodeData *){
+ QSGNode* updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
+ {
iterations++;
update();
return nullptr;
@@ -2513,7 +2521,8 @@ public:
~RenderJob() { ++deleted; }
QQuickWindow::RenderStage stage;
QList<QQuickWindow::RenderStage> *list;
- void run() {
+ void run() override
+ {
list->append(stage);
}
static int deleted;
@@ -2697,9 +2706,12 @@ public:
setAcceptHoverEvents(true);
}
- void hoverEnterEvent(QHoverEvent *event) { hoverTimestamps << event->timestamp(); }
- void hoverLeaveEvent(QHoverEvent *event) { hoverTimestamps << event->timestamp(); }
- void hoverMoveEvent(QHoverEvent *event) { hoverTimestamps << event->timestamp(); }
+ void hoverEnterEvent(QHoverEvent *event) override
+ { hoverTimestamps << event->timestamp(); }
+ void hoverLeaveEvent(QHoverEvent *event) override
+ { hoverTimestamps << event->timestamp(); }
+ void hoverMoveEvent(QHoverEvent *event) override
+ { hoverTimestamps << event->timestamp(); }
QList<ulong> hoverTimestamps;
};
@@ -2892,19 +2904,19 @@ public:
dropAccept = true;
}
- void dragEnterEvent(QDragEnterEvent *event)
+ void dragEnterEvent(QDragEnterEvent *event) override
{
event->setAccepted(enterAccept);
event->setDropAction(enterDropAction);
}
- void dragMoveEvent(QDragMoveEvent *event)
+ void dragMoveEvent(QDragMoveEvent *event) override
{
event->setAccepted(moveAccept);
event->setDropAction(moveDropAction);
}
- void dropEvent(QDropEvent *event)
+ void dropEvent(QDropEvent *event) override
{
event->setAccepted(dropAccept);
event->setDropAction(dropDropAction);