Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear all items of QListView

Tags:

qt

qlistview

I searched a lot but I could not understand how to clear all items of QListView?

I used QStringListModel and QStringList to fill it.

like image 344
Mohammad Reza Ramezani Avatar asked Sep 03 '15 06:09

Mohammad Reza Ramezani


1 Answers

You can either use model.setStringList( QStringList{} ), or manually delete the rows with model.removeRows( 0, model.rowCount() ).

like image 119
cmannett85 Avatar answered Oct 24 '22 08:10

cmannett85