diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-10-04 19:12:03 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-10-05 17:30:33 +0200 |
commit | 87b80813d2b944479a589e2308f0846eb0e205f3 (patch) | |
tree | bbb86598c37017747182fe13b3090490915df3ac /tests/manual | |
parent | 4bf5a273fad016536a653cf930c9bcacd139b7ce (diff) |
Stop using QHash::unite() in storage model manual test
It was deprecated in qtbase 9c124b1b0a3730978699b8a6420308b5e5ab4e4e
and removed in Qt 6.
Pick-to: 5.15 6.2 6.1
Change-Id: I0039bca92d005fc6533106662fc655ae7f76cc0b
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/tableview/storagemodel/storagemodel.cpp | 25 |
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() |