From 9a9df880cf78580c35f9ec31b3f522c4fe045e9f Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 4 Oct 2021 19:12:03 +0200 Subject: Stop using QHash::unite() in storage model manual test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was deprecated in qtbase 9c124b1b0a3730978699b8a6420308b5e5ab4e4e and removed in Qt 6. Change-Id: I0039bca92d005fc6533106662fc655ae7f76cc0b Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 87b80813d2b944479a589e2308f0846eb0e205f3) Reviewed-by: Qt Cherry-pick Bot --- .../manual/tableview/storagemodel/storagemodel.cpp | 25 ++++++++++++---------- 1 file 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 StorageModel::roleNames() const { - static auto roles = QHash { - { 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(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() -- cgit v1.2.3