PDA

View Full Version : listview



addu
11th May 2009, 11:51
Hi

How clear the listview . i referred the listview .i dson't get any thing


please help me


Thanks

Lykurg
11th May 2009, 12:02
How clear the listview .

QAbstractItemModel *m = view->model();
view->setModel(/*new empty model*/);
delete m;

talk2amulya
11th May 2009, 13:05
if you dont want to change your current model, and assuming your model is of type QStandardItemModel, here is how to do it:


QStandardItemModel *mdl = (QStandardItemModel *)view->model();
mdl->clear();// your view will be automatically updated by this, unless you have your own custom model