QListView::setIndexWidget custom sorting
Hello!
I have the QListView widget and add my custom widget (QLabel and QPushButton placed on QHBoxLayout) with setIndexWidget().
Is it possible to overload any method of QListView to specify sorting function?
I was trying to use QSortFilterProxyModel but I'm not sure of how to link my custom widget with QModelIndex.
Thanks.
Re: QListView::setIndexWidget custom sorting
I'd recommend to apply all kinds of sorting using a model.
Can you be more specific with the relations between the QListView, your custom widget and data you want to fill them with? Maybe some code with definitions?
Re: QListView::setIndexWidget custom sorting
Quote:
Originally Posted by
Vit Stepanek
I'd recommend to apply all kinds of sorting using a model.
Can you be more specific with the relations between the QListView, your custom widget and data you want to fill them with? Maybe some code with definitions?
Well, I add buttons to the QListView and want them to be sorted in the column using their text() value. How could it be implemented in general?
I found many examples if placing just strings to cells in QTreeView or QTableView. But how to deal with widgets (and sorting ) beeing inserted into the cell ?