Hi All,

I've a newb question, could use a bit of help understanding how best to use models/views, hope someone can help.

I'm working on a configuration dialog for a program and the data structure being modified is a list of "instances" (objects) each of which has a couple of properties like "name" (string), "optional" (bool), "libraries" (QStringList). I tried using QStandardItemModel for the top level list, presenting "name" as column 0, "optional" as column 1 and "libraries" as column 2 (adding individual files to QStandardItem using its appendRows method), however something seems to be missing as mapping to widgets using QDataWidgetMapper only works for simple values like the string or bool, but mapping column 2 (a QStandardItem with multiple rows) to a QListView doesn't work.

So a couple of questions:

1. is it possible to map a list value to a QListView and if so how? am I thinking in the right direction with the QStandardItem?

2. am I missing a piece of the puzzle? something like a custom delegate? what would it need to do?

3. are models supposed to encapsulate the entire data structure (e.g. in this case the top level list) and fit in and present the data as either a list, table or tree that views expect? Or are you supposed to have models for each composite data e.g. a model for top-level list of objects (presenting "name" and "optional" as columns) and a separate model for each object's list of files? How would you use that then to map to editor widgets?

Many thanks,
Michael