Silence compiler warning

Don't get a QModelIndex out of a temporary QPersistentModelIndex.

Change-Id: Ida9e25f1a17130e19b75221e1189e6f2fccd3f27
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit c4a8c2b0d039f34b26ddd70c7e66022a037a10c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2023-09-08 16:21:53 +02:00 committed by Qt Cherry-pick Bot
parent c31a907028
commit 99720e3b2b

View File

@ -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);