From c4a8c2b0d039f34b26ddd70c7e66022a037a10c4 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 8 Sep 2023 16:21:53 +0200 Subject: Silence compiler warning Don't get a QModelIndex out of a temporary QPersistentModelIndex. Pick-to: 6.6 Change-Id: Ida9e25f1a17130e19b75221e1189e6f2fccd3f27 Reviewed-by: Santhosh Kumar --- tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp index 1bd7caeb9b..0b99e49392 100644 --- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp +++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp @@ -307,7 +307,7 @@ void ModelChangeChildrenLayoutsCommand::doCommand() // changing any children of that parent. The reason is that we're keeping parent1 and parent2 // around as QPersistentModelIndex instances, and we query idx.parent() in the loop. QModelIndexList persistent = m_model->persistentIndexList(); - for (const QModelIndex &parent : parents) { + for (const QPersistentModelIndex &parent : parents) { int idx = persistent.indexOf(parent); if (idx != -1) persistent.move(idx, 0); -- cgit v1.2.3