Reviewing merge request #2260: Fixing bug with q3listview sorting
Q3ListViewItem::sortChildItems() exits early if there is only 1 child
item and leaves grandchildren unsorted.
Commits that would be merged:
Comments
The continuation of the function calls:
if (siblings[i].item->isOpen())
siblings[i].item->sort();
I think the same should be done if there is one child.
Can you please make an autotest?
If the early return is fixed the continuation would call sort on the child, so semantically the lines:
if (childItem->siblingItem == 0)
{
childItem->sortChildItems(column, ascending);
return;
}
are not needed. I put them there to avoid cost of setting up the env for sorting that also involves memory allocation. All that was not needed.
Can you please make an autotest?
Can you please what you mean by autotest? Is there a Qt test suite already where I shall add an extra test or you want me to make a standalone program that demonstrates the bug and its fix?
An autottest is a test in tests/auto/
My question was why calling sortChildItems instead of isOpen() and sort()
Auto test is added.
Calling sortChildItems() only if the item is opened is a very good idea :)
That is also changed now.
Merged in 9bba92715d96939e4d36c6ea42e8b466756bf891


Add a new comment:
Login or create an account to post a comment