PDA

View Full Version : multiple QListViews on one QAbstractListModel



tesmai4
5th November 2013, 16:15
Dear all,

I have one QAbstractListModel and I it in two QListViews in different ways. First QListView is a pop-up and will display only a selection of the items in QAbstractListModel. I hide this view when escape key is pressed. Whereas, second QListView is part of the QMainWindow and will display all items in the QAbstractListModel.

I am stuck at two points:

1) How to make selection from QAbstractListModel for the first QListView?
2) I need to clear the items displayed in second QListView when escape key is pressed for hiding the first QListView.


any idea how t o do this? Any little help will be appreciated.

anda_skoa
5th November 2013, 18:51
For (1) you could use a QSortFilterProxyModel or use a second model on top of the same data.

No idea what you mean with (2) though. The second list view should be empty after you close the popup?

Cheers,
_