Silence compiler warning

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

Pick-to: 6.6
Change-Id: Ida9e25f1a17130e19b75221e1189e6f2fccd3f27
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-09-08 16:21:53 +02:00
parent bf2587d9e5
commit c4a8c2b0d0

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