3

Hey I am trying build a table with a multiple filtering functions on top of each other. I have already figured out how to filter rows with search strings using RexExp and QSortFilterProxy on top of QAbstractTableModel. But I also would like the QSortFilterProxy to filter for row indices.But I could not figure out how to do it. So instead of:

search = QtCore.QRegExp(text,QtCore.Qt.CaseInsensitive, QtCore.QRegExp.Wildcard) self.ProxyModelSelect.setFilterRegExp(search)

I would like to have smth like(method totaly madeup):

self.ProxyModelSelect.rowFiltering(rowIndBegin,rowIndEnd)

So that it hides the range of rows from the view. I cannot use QTableView.setRowHidden function cause when the table indices change with sorting everything gets messed up. Need to do it with proxy model or inside the base model.

bop
  • 435
  • 1
  • 3
  • 11
  • It's difficult to judge without seeing a more complete code example but... assuming you're correctly mapping the indexes to/from the source model you may also have to make use of [QPersistentModelIndex](http://doc.qt.io/qt-5/qpersistentmodelindex.html) – G.M. Jun 18 '16 at 07:52

0 Answers0