I have a XML file with the following structure:
Qt Code:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <isl_project_command>
  3. <task>
  4. <code>root</code>
  5. <parent_code></parent_code>
  6. <start_date>date</start_date>
  7. </task>
  8. <task>
  9. <code>child1</code>
  10. <parent_code>root</parent_code>
  11. <start_date>date</start_date>
  12. </task>
  13. <task>
  14. <code>child1.1</code>
  15. <parent_code>child1</parent_code>
  16. <start_date>date</start_date>
  17. </task>
  18. </isl_project_command>
To copy to clipboard, switch view to plain text mode 

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: