Form tree structure from qstandarditemmodel data
<p>I have a csv file which has data as follows:</p>

<pre><code>type1, item1, &lt;parameters of item1&gt;
type2, item2, &lt;parameters of item2&gt;
type3, item3, &lt;parameters of item3&gt;
type4, item4, &lt;parameters of item4&gt;
type4, item5, &lt;parameters of item5&gt;
type5, item6, &lt;parameters of item6&gt;
type5, item7, &lt;parameters of item7&gt;
type1, item8, &lt;parameters of item8&gt;
type2, item9, &lt;parameters of item9&gt;
...
</code></pre>

<p>In the above data, the items 2 to 7 belong to type 1 (i.e, item1 is the parent of elements item2 to item7 and they might or might not be of the same type).</p>

<p>My goal is to display the above data in the form of a tree structure. For this, I have first fetched all the data from the csv file into a QStandardItemModel.
Now I am unsure of how to proceed from hereon in order to display the above in the form of a tree.</p>

<p>Could someone help me with advice on how to proceed from here.</p>