aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickvisualdatamodel
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/qquickvisualdatamodel
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/qquickvisualdatamodel')
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
index 49ed29e88f..0037747043 100644
--- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
+++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
@@ -105,7 +105,7 @@ public:
}
~SingleRoleModel() {}
- QHash<int,QByteArray> roleNames() const
+ QHash<int,QByteArray> roleNames() const override
{
QHash<int,QByteArray> roles;
roles.insert(Qt::DisplayRole, m_role);
@@ -130,7 +130,7 @@ public:
}
}
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const {
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override {
if (row < 0 || column != 0)
return QModelIndex();
Branch * const branch = branchForIndex(parent);
@@ -139,24 +139,24 @@ public:
: QModelIndex();
}
- QModelIndex parent(const QModelIndex &child) const {
+ QModelIndex parent(const QModelIndex &child) const override {
Branch * const branch = static_cast<Branch *>(child.internalPointer());
return branch->parent
? createIndex(branch->parent->indexOf(branch), 0, branch->parent)
: QModelIndex();
}
- int rowCount(const QModelIndex &parent) const {
+ int rowCount(const QModelIndex &parent) const override {
Branch * const branch = branchForIndex(parent);
return branch ? branch->children.count() : 0;
}
- int columnCount(const QModelIndex &parent) const {
+ int columnCount(const QModelIndex &parent) const override {
Branch * const branch = branchForIndex(parent);
return branch ? 1 : 0;
}
- QVariant data(const QModelIndex &index, int role) const {
+ QVariant data(const QModelIndex &index, int role) const override {
return index.isValid() && role == Qt::DisplayRole
? static_cast<Branch *>(index.internalPointer())->children.at(index.row()).display
: QVariant();