问题
I'm using Pyside2, python 3.8, Qt 5.
I have a
QTableView
with aQAbstractTableModel
to it. I have a Combobox (ComboBoxColumns) that lists all my columns headers, and a second Combobox (ComboBoxValues) that lists all the distinct values in the column that is selected in the ComboBoxColumns. My two ComboBoxs are connected to two different QStringListModel.What I want is to only keep the rows where the Value(row, ComboboxColumns.currentIndex) == ComboBoxValues.currentIndex.
I'm trying to implement a PrxyModel class from QSortFilterProxyModel, even after two days of reading documentations and other threads on StackOverflow, Qt Forum. I still have no clue on how to do it.
来源:https://stackoverflow.com/questions/65336881/filter-qtableview-rows-with-qsortfilterproxymodel-and-combobox