QTreeWidget - scrolls to top when removing items
Hello,
I have a very annoying problem (4.2.1). I have alot of items in my treewidget and the user can select an item and remove it from the view. I just call QTreeWidget::takeTopLevelItem(index) and the item gets removed BUT assuming the item was somewhere down the list and after removing it, the treewidget automatically scrolls to the top of the list.
I even tried this:
Code:
int y = treewidget->verticalScrollBar()->value();
treewidget->takeTopLevelItem(index);
treewidget->verticalScrollBar()->setValue(y);
But it doesn't make any difference. I also dumped the variable y into a file and it always said valid values like 863, 672 ...
It's really annoying and in Qt3/QListView this never happened. Thank you guys.
Re: QTreeWidget - scrolls to top when removing items
This indeed feels like a nasty bug. Have you reported this to the Trolls?
Re: QTreeWidget - scrolls to top when removing items
Well, I did now :)
I hope this bug (=when adding items the treewidget doesn't scroll anywhere) will be fixed soon and they release 4.2.2 cos I can't wait a couple of months until 4.3.0.
I'm curious though if anyone is able to reproduce this behavior?