C++ (Qt)QTreeWidget *leafItem; // MyFolderQString path = leafItem->text(0);QTreeWidget *item = leafItem;while (item = item->parent()) path += item->text(0) + "->";