From 0d28805cc7790511b9414a900be57f3b2d8d63a8 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sun, 11 Apr 2021 11:12:51 +0200 Subject: Mark overrides in tests to silence compiler warnings Pick-to: 6.1 Change-Id: Ieed929dcd7b550a1dc365d34b6f20f2f0e2d057f Reviewed-by: Shawn Rutledge --- tests/auto/qml/qqmlitemmodels/qtestmodel.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/auto/qml/qqmlitemmodels') diff --git a/tests/auto/qml/qqmlitemmodels/qtestmodel.h b/tests/auto/qml/qqmlitemmodels/qtestmodel.h index de42253708..a5d20d5653 100644 --- a/tests/auto/qml/qqmlitemmodels/qtestmodel.h +++ b/tests/auto/qml/qqmlitemmodels/qtestmodel.h @@ -76,15 +76,15 @@ public: return QString("[%1,%2,%3,%4]").arg(idx.row()).arg(idx.column()).arg(idx.internalId()).arg(hasChildren(idx)); } - bool canFetchMore(const QModelIndex &) const { + bool canFetchMore(const QModelIndex &) const override { return !fetched; } - void fetchMore(const QModelIndex &) { + void fetchMore(const QModelIndex &) override { fetched = true; } - bool hasChildren(const QModelIndex &parent = QModelIndex()) const { + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override { bool hasFetched = fetched; fetched = true; bool r = QAbstractItemModel::hasChildren(parent); @@ -92,7 +92,7 @@ public: return r; } - int rowCount(const QModelIndex& parent = QModelIndex()) const { + int rowCount(const QModelIndex& parent = QModelIndex()) const override { if ((parent.column() > 0) || (level(parent) > levels) || (alternateChildlessRows && parent.row() > 0 && (parent.row() & 1))) return 0; @@ -102,7 +102,7 @@ public: return n->children.count(); } - int columnCount(const QModelIndex& parent = QModelIndex()) const { + int columnCount(const QModelIndex& parent = QModelIndex()) const override { if ((parent.column() > 0) || (level(parent) > levels) || (alternateChildlessRows && parent.row() > 0 && (parent.row() & 1))) return 0; @@ -115,7 +115,7 @@ public: return false; } - Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const + Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override { if (row < 0 || column < 0 || (level(parent) > levels) || column >= cols) return QModelIndex(); @@ -133,7 +133,7 @@ public: return createIndex(row, column, n); } - QModelIndex parent(const QModelIndex &index) const + QModelIndex parent(const QModelIndex &index) const override { Node *n = (Node *)index.internalPointer(); if (!n || n->parent == tree) @@ -144,7 +144,7 @@ public: return createIndex(parentRow, 0, n->parent); } - QVariant data(const QModelIndex &idx, int role) const + QVariant data(const QModelIndex &idx, int role) const override { if (!idx.isValid()) return QVariant(); @@ -169,7 +169,7 @@ public: return QVariant(); } - bool setData(const QModelIndex &index, const QVariant &value, int role) + bool setData(const QModelIndex &index, const QVariant &value, int role) override { Q_UNUSED(value); QVector changedRole(1, role); @@ -188,7 +188,7 @@ public: emit layoutChanged(parents); } - bool removeRows(int row, int count, const QModelIndex &parent) + bool removeRows(int row, int count, const QModelIndex &parent) override { beginRemoveRows(parent, row, row + count - 1); Node *n = (Node *)parent.internalPointer(); @@ -213,7 +213,7 @@ public: endRemoveColumns(); } - bool insertRows(int row, int count, const QModelIndex &parent) + bool insertRows(int row, int count, const QModelIndex &parent) override { beginInsertRows(parent, row, row + count - 1); Node *n = (Node *)parent.internalPointer(); @@ -224,7 +224,7 @@ public: return true; } - bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) + bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override { Q_ASSERT_X(sourceRow >= 0 && sourceRow < rowCount(sourceParent) && count > 0 && sourceRow + count < rowCount(sourceParent) -- cgit v1.2.3