I searched a lot but I could not understand how to clear all items of QListView
?
I used QStringListModel
and QStringList
to fill it.
I searched a lot but I could not understand how to clear all items of QListView
?
I used QStringListModel
and QStringList
to fill it.
You can either use model.setStringList( QStringList{} )
, or manually delete the rows with model.removeRows( 0, model.rowCount() )
.
This is working fine for me.
model1->removeRows( 0, model1->rowCount());
© 2022 - 2024 — McMap. All rights reserved.