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:
	
	- class cdNamespace   
- { 
- public: 
- 	cdNamespace(); 
-   
- 	qint32 ID; 
- 	QVector<cdObject> Objects; 
- 	qint32 NumberOfObjects(void); 
- 	QVector<cdNamespace> Namespaces; 
- 	qint32 NumberOfNamespaces(void); 
- } 
        class cdNamespace  
{
public:
	cdNamespace();
	qint32 ID;
	QString Name;
	QString Description;
	QVector<cdObject> Objects;
	qint32 NumberOfObjects(void);
	QVector<cdNamespace> Namespaces;
	qint32 NumberOfNamespaces(void);
}
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
				
			
Bookmarks