cyang
17th September 2010, 20:22
Hi all,
I just started coding Qt, and am struggling with some UI features. Please let me know if I can find some sample code or just API for this issue, thanks!
I am using a QStandardItemModel to store QStandardItem to display in QListView, I wonder if there's a simple separator type for QStandardItem, so that I can feed into QStandardItemModel then QListView directly? Essentially I want to implement a address book like list with separators in the list.
QListview *listview = new QListView()
QStandardItemModel *model = new QStandardItemModel();
for (int i =0; i<num; i++)
{
QStandardItem *item = new QStandardItem();
model->appendRow(item);
}
listview->setModel(model);
I just started coding Qt, and am struggling with some UI features. Please let me know if I can find some sample code or just API for this issue, thanks!
I am using a QStandardItemModel to store QStandardItem to display in QListView, I wonder if there's a simple separator type for QStandardItem, so that I can feed into QStandardItemModel then QListView directly? Essentially I want to implement a address book like list with separators in the list.
QListview *listview = new QListView()
QStandardItemModel *model = new QStandardItemModel();
for (int i =0; i<num; i++)
{
QStandardItem *item = new QStandardItem();
model->appendRow(item);
}
listview->setModel(model);