Quote Originally Posted by Lykurg View Post
Qt Code:
  1. QTreeWidgetItem *child = /*currentItem() or whatever*/;
  2. QTreeWidgetItem *parent = child->parent(); //check if valid
  3. QTreeWidgetItem *grandparent = parent->parent(); //check if valid
  4. int index_child = parent->indexOfChild(child);
  5. int index_parent = grandparent->indexOfChild(parent);
To copy to clipboard, switch view to plain text mode 
Thank you very much, I did not understand what was grandparent.

Best regards