aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/tableview/storagemodel/storagemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/tableview/storagemodel/storagemodel.cpp')
-rw-r--r--tests/manual/tableview/storagemodel/storagemodel.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/manual/tableview/storagemodel/storagemodel.cpp b/tests/manual/tableview/storagemodel/storagemodel.cpp
index b43454b249..f0394db6b8 100644
--- a/tests/manual/tableview/storagemodel/storagemodel.cpp
+++ b/tests/manual/tableview/storagemodel/storagemodel.cpp
@@ -64,17 +64,20 @@ StorageModel::StorageModel(QObject *parent) :
}
QHash<int, QByteArray> StorageModel::roleNames() const {
- static auto roles = QHash<int, QByteArray> {
- { int(Role::Type), "type" },
- { int(Role::Heading), "heading" },
- { int(Role::Value), "value" },
- { int(Role::ValueMax), "valueMax" },
- { int(Role::ValueDisplay), "valueDisplay" },
- { int(Role::ValueMaxDisplay), "valueMaxDisplay" },
- { Qt::CheckStateRole, "checkState" },
- };
- static auto ret = roles.unite(QAbstractTableModel::roleNames());;
- return ret;
+ static auto roles = [this]() {
+ auto roles = QHash<int, QByteArray> {
+ { int(Role::Type), "type" },
+ { int(Role::Heading), "heading" },
+ { int(Role::Value), "value" },
+ { int(Role::ValueMax), "valueMax" },
+ { int(Role::ValueDisplay), "valueDisplay" },
+ { int(Role::ValueMaxDisplay), "valueMaxDisplay" },
+ { Qt::CheckStateRole, "checkState" }
+ };
+ roles.insert(QAbstractTableModel::roleNames());
+ return roles;
+ }();
+ return roles;
}
void StorageModel::refresh()