Worked as a charm!
Thank you very much.
int row = this->currentIndex().row();
if (item && row > 0)
{
int index = parent->indexOfChild(item);
parent->insertChild(index-1, child);
parent->setExpanded(true);
child->setExpanded(true);
}
QTreeWidgetItem* item = this->currentItem();
int row = this->currentIndex().row();
if (item && row > 0)
{
QTreeWidgetItem* parent = item->parent();
int index = parent->indexOfChild(item);
QTreeWidgetItem* child = parent->takeChild(index);
parent->insertChild(index-1, child);
parent->setExpanded(true);
child->setExpanded(true);
}
To copy to clipboard, switch view to plain text mode
Bookmarks