diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-10-04 19:12:03 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-12 12:55:28 +0000 |
commit | 9a9df880cf78580c35f9ec31b3f522c4fe045e9f (patch) | |
tree | eb1e6810ec663528dfc7749a7d6ec08afd3dae95 | |
parent | 0e5cb85a1021815c1a3d38a67e936d90b59ddf45 (diff) |
Stop using QHash::unite() in storage model manual test
It was deprecated in qtbase 9c124b1b0a3730978699b8a6420308b5e5ab4e4e
and removed in Qt 6.
Change-Id: I0039bca92d005fc6533106662fc655ae7f76cc0b
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 87b80813d2b944479a589e2308f0846eb0e205f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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() |