I want to display data in multiple columns in a QColumnView. I use Qt Creator and Qt 4 for development.
Consider the address book application, where you have several groups: group 1, group 2, etc. Your contacts can belong to any of these groups.
Group 1:
John Smith
Pocahontas
Group 2:
Chief Powhatan
Group 3:
...
When a group in the first column is selected, in the second column all contacts in this group will be shown, and when a contact is selected, their personal information is displayed in the third column.
I tried the following (using the Qt Documentation example):
QStringList strList1;
strList1 << "Group 1" << "Group 2" << "Group 3";
strListM1 = new QStringListModel();
strListM1->setStringList(strList1);
ui->columnView->setModel(strListM1);
However, I was not able to figure out how to add more columns, and add contact names as children of these groups in the first column.
? ( QStringList, , )?