Worked as a charm!
Thank you very much.

Qt Code:
  1. QTreeWidgetItem* item = this->currentItem();
  2. int row = this->currentIndex().row();
  3. if (item && row > 0)
  4. {
  5. QTreeWidgetItem* parent = item->parent();
  6. int index = parent->indexOfChild(item);
  7. QTreeWidgetItem* child = parent->takeChild(index);
  8. parent->insertChild(index-1, child);
  9. parent->setExpanded(true);
  10. child->setExpanded(true);
  11. }
To copy to clipboard, switch view to plain text mode