QTreeWidget: Fixed reverse order of first level items in Drag and Drop
The list with taken indexes (selected items) was created in reverse order but then retrieved from beginning. This was causing unexpected rotation of the moved items. Task-number: QTBUG-45320 Change-Id: I858d9af7b838bbd2618442c176dac0648b3512c4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
a41cd126a3
commit
3ae1eb6236
@ -3386,7 +3386,7 @@ void QTreeWidget::dropEvent(QDropEvent *event) {
|
||||
|
||||
// Remove the items
|
||||
QList<QTreeWidgetItem *> taken;
|
||||
for (int i = indexes.count() - 1; i >= 0; --i) {
|
||||
for (int i = 0; i < indexes.count(); ++i) {
|
||||
QTreeWidgetItem *parent = itemFromIndex(indexes.at(i));
|
||||
if (!parent || !parent->parent()) {
|
||||
taken.append(takeTopLevelItem(indexes.at(i).row()));
|
||||
|
Loading…
Reference in New Issue
Block a user