PDA

View Full Version : qlistwidget custome sorting



migel
1st September 2011, 11:55
How to sort an items from custom item role ?

Like QTableView has!


model = new QStandardItemModel(this);
_model->setSortRole(ListView::sortRole);

I know I can do
item->setData(Qt::DisplayRole, number); but I add a widget to the item and don't want a display role here