aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickitem2
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/qquickitem2
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/qquickitem2')
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 7147cb9b9d..211306c2a5 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -202,7 +202,7 @@ public:
KeyTestItem(QQuickItem *parent=nullptr) : QQuickItem(parent), mKey(0) {}
protected:
- void keyPressEvent(QKeyEvent *e) {
+ void keyPressEvent(QKeyEvent *e) override {
mKey = e->key();
if (e->key() == Qt::Key_A)
@@ -211,7 +211,7 @@ protected:
e->ignore();
}
- void keyReleaseEvent(QKeyEvent *e) {
+ void keyReleaseEvent(QKeyEvent *e) override {
if (e->key() == Qt::Key_B)
e->accept();
else
@@ -225,7 +225,7 @@ public:
class FocusEventFilter : public QObject
{
protected:
- bool eventFilter(QObject *watched, QEvent *event) {
+ bool eventFilter(QObject *watched, QEvent *event) override {
if ((event->type() == QEvent::FocusIn) || (event->type() == QEvent::FocusOut)) {
QFocusEvent *focusEvent = static_cast<QFocusEvent *>(event);
lastFocusReason = focusEvent->reason();
@@ -266,7 +266,7 @@ public:
qreal holeRadius() const { return m_holeRadius; }
void setHoleRadius(qreal radius) { m_holeRadius = radius; }
- bool contains(const QPointF &point) const {
+ bool contains(const QPointF &point) const override {
const qreal w = width();
const qreal h = height();
const qreal r = m_holeRadius;
@@ -288,10 +288,10 @@ public:
}
protected:
- void hoverEnterEvent(QHoverEvent *) { m_isHovered = true; }
- void hoverLeaveEvent(QHoverEvent *) { m_isHovered = false; }
- void mousePressEvent(QMouseEvent *) { m_isPressed = true; }
- void mouseReleaseEvent(QMouseEvent *) { m_isPressed = false; }
+ void hoverEnterEvent(QHoverEvent *) override { m_isHovered = true; }
+ void hoverLeaveEvent(QHoverEvent *) override { m_isHovered = false; }
+ void mousePressEvent(QMouseEvent *) override { m_isPressed = true; }
+ void mouseReleaseEvent(QMouseEvent *) override { m_isPressed = false; }
private:
bool m_isPressed;