Dear Qt masters,

I have the following very simple "model":

Qt Code:
  1. typedef QPair<QString,QStringList> EnumDefinition;
  2. typedef QList<EnumDefinition> EnumDefinitionList;
  3. EnumDefinitionList enumTypes;
  4.  
  5. // ... example:
  6. enumTypes[0].first = "Boolean";
  7. enumTypes[0].second[0] = "False";
  8. enumTypes[0].second[1] = "True";
  9. enumTypes[1].first = "Color";
  10. enumTypes[1].second[0] = "Red";
  11. enumTypes[1].second[1] = "Green";
  12. enumTypes[1].second[2] = "Blue";
To copy to clipboard, switch view to plain text mode 

Now I would like this to display in a tree view as:

- Boolean
+-- False
+-- True
- Color
+-- Red
+-- Green
+-- Blue

Can this be done using the QAbstractItemModel?
(I am a little confused about the mapping between QModelIndex
and the indexes in my EnumDefinitionList)

Many thanks,

Oliver