View Full Version : listview
Hi
How clear the listview . i referred the listview .i dson't get any thing
please help me
Thanks
Lykurg
11th May 2009, 11:02
How clear the listview .
QAbstractItemModel *m = view->model();
view->setModel(/*new empty model*/);
delete m;
talk2amulya
11th May 2009, 12: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
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.