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:
parent
c31a907028
commit
99720e3b2b
@ -307,7 +307,7 @@ void ModelChangeChildrenLayoutsCommand::doCommand()
|
|||||||
// changing any children of that parent. The reason is that we're keeping parent1 and parent2
|
// 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.
|
// around as QPersistentModelIndex instances, and we query idx.parent() in the loop.
|
||||||
QModelIndexList persistent = m_model->persistentIndexList();
|
QModelIndexList persistent = m_model->persistentIndexList();
|
||||||
for (const QModelIndex &parent : parents) {
|
for (const QPersistentModelIndex &parent : parents) {
|
||||||
int idx = persistent.indexOf(parent);
|
int idx = persistent.indexOf(parent);
|
||||||
if (idx != -1)
|
if (idx != -1)
|
||||||
persistent.move(idx, 0);
|
persistent.move(idx, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user