Hello.

I'm trying to write a simple timetracker, and perhaps I'm doing this the wrong way, so I must ask for advice (since I'm not really comfortable yet with the modell/view programming).

In my program, I enter a label for a task and start/stop a timer. Then I want to store each time interval for each unique task label and display the total running time for each unique label.
For example: the labels and times
A: 10
B: 20
A: 30

should be displayd with
A:40
B:20

To do this, I have a class Task that is a subclass of QStandardItem and I save the time intervals in a QList and sets the name of the task by using
this->setText(label);
THen I save the item in a QStandardItemModel. I display in a QListView and get the result
A
B

but no times. So, what should I do to display the total time next to the label string? Can I use a special role? How? I'm stuck here.

The way I then add another label and time, for example A: 14, I search for the item in the model with the label A and add the value 14 to the QList and calculate the sum for label A.

Any suggestions?