Adding some path to a QListView
-
bq. new QListViewItem(ui->listView, path);
Initialised to ?
And you want to use QListView ,not "QListWidget":http://doc.qt.nokia.com/latest/qlistwidget.html ?
-
Am sorry if am not clear.
I think , there is a problem with line 7. Initialization issue.EDIT : you can have a look at "this":http://www.qtforum.org/article/27479/how-to-insert-new-items-into-a-qlistview.html .Hope its useful to you.
-
If you want to use QList_View_, then you are using it with a model, a QAIM subclass. If you want to add something to the displayed list, you have to add that piece of data to the model. The view will then display it. You are not telling us what type of model you are using, so it is hard to tell you how to do this.
In your small code sample, you are trying to do something that looks more like how you would work with QListWidget. That will not work. Perhaps your model is a QStandardItemModel? In that case, you can add a new item to this model with a syntax that looks a bit like what you are trying to do.