From 00076a2695ddf429f478b43472b742921288bba0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 3 Dec 2018 10:29:07 +0100 Subject: Don't insert items into the wrong row This happened to work by chance, as QList::insert() would gracefully handle out of bounds insertions. Change-Id: I7ee1e645ed9a538946a509957ce5155641ffea1d Reviewed-by: David Faure --- tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp index c8698242d5..ecc95d30b6 100644 --- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp +++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp @@ -228,7 +228,7 @@ void ModelMoveCommand::doCommand() if (srcParent == destParent) d = m_destRow - (m_endRow - m_startRow + 1); else - d = m_destRow - (m_endRow - m_startRow) + 1; + d = m_destRow; } foreach (const qint64 id, l) -- cgit v1.2.3