Fix bug where index is wrong when a group is moved to the end from the same parent.

This triggered the bug:
group->setParent(group->parentGroup());

Then index was group->parentGroup()->children().size() instead of size()-1.
This commit is contained in:
Felix Geyer 2012-04-25 00:10:06 +02:00
parent 974d4f5807
commit 0d20955920
2 changed files with 14 additions and 0 deletions

View file

@ -135,6 +135,14 @@ void TestGroup::testSignals()
QCOMPARE(spyAboutToMove.count(), 0);
QCOMPARE(spyMoved.count(), 0);
g2->setParent(root);
QCOMPARE(spyAboutToAdd.count(), 2);
QCOMPARE(spyAdded.count(), 2);
QCOMPARE(spyAboutToRemove.count(), 0);
QCOMPARE(spyRemoved.count(), 0);
QCOMPARE(spyAboutToMove.count(), 0);
QCOMPARE(spyMoved.count(), 0);
g2->setParent(root, 0);
QCOMPARE(spyAboutToAdd.count(), 2);
QCOMPARE(spyAdded.count(), 2);