hi.
I'm having a problem with QTreeWidget. i have tree data of unknown depth (readed from XML file), so i'm wondering which is the easiest way to get depth of selected item, so i could take needed indexes of all its parents.
for illustartion, some code:
Qt Code:
  1. class cdNamespace
  2. {
  3. public:
  4. cdNamespace();
  5.  
  6. qint32 ID;
  7. QString Name;
  8. QString Description;
  9. QVector<cdObject> Objects;
  10. qint32 NumberOfObjects(void);
  11. QVector<cdNamespace> Namespaces;
  12. qint32 NumberOfNamespaces(void);
  13. }
To copy to clipboard, switch view to plain text mode 
My tree control is having unknown depth trough namespaces, and i need to know which namespace is selected. objects are also displayed in tree, which make this even more difficult.
I have an idea to to this with recursive function, but maybe there is an esier way?

thanx