wind
19th September 2006, 16:29
I have a XML file with the following structure:
<?xml version="1.0" encoding="utf-8"?>
<isl_project_command>
<task>
<code>root</code>
<parent_code></parent_code>
<start_date>date</start_date>
</task>
<task>
<code>child1</code>
<parent_code>root</parent_code>
<start_date>date</start_date>
</task>
<task>
<code>child1.1</code>
<parent_code>child1</parent_code>
<start_date>date</start_date>
</task>
</isl_project_command>
Now i try to build a QStandardModel of this structure for displaying data in a QTreeView.
The problem is i don't know how to create a hierarchy tree of the data.
The tree should look something like this: http://files.lagoji.si/w2.PNG
<?xml version="1.0" encoding="utf-8"?>
<isl_project_command>
<task>
<code>root</code>
<parent_code></parent_code>
<start_date>date</start_date>
</task>
<task>
<code>child1</code>
<parent_code>root</parent_code>
<start_date>date</start_date>
</task>
<task>
<code>child1.1</code>
<parent_code>child1</parent_code>
<start_date>date</start_date>
</task>
</isl_project_command>
Now i try to build a QStandardModel of this structure for displaying data in a QTreeView.
The problem is i don't know how to create a hierarchy tree of the data.
The tree should look something like this: http://files.lagoji.si/w2.PNG