Conception for a table with 1st row as a filter
-
Hi,
I want to setup a table with a filter for each column. I want those filters (a regex string) to stay on the 1st row (or be direclty integrated in the header but I don't think that would be simplier).
I have a working QAbstractTable and a QTableView. And I would like to set the filters in a QAbstractProxyModel. I've been experimenting with QSortFilterProxyModel by adding a row and shifting the row index from/to the model. But those classes are made to hide data from the model not add to it. So I'm having troubles with index management. I keep looking and I might ask a question about that later.
But right now, I would like your thoughts on the conception/patterns. Is this the right way to do it ? Do you have other ideas ?
Thanks, -
Well here is what I came up with:
https://github.com/Ch4rle5/columnFilteredTableExample -
Hi,
I want to setup a table with a filter for each column. I want those filters (a regex string) to stay on the 1st row (or be direclty integrated in the header but I don't think that would be simplier).
I have a working QAbstractTable and a QTableView. And I would like to set the filters in a QAbstractProxyModel. I've been experimenting with QSortFilterProxyModel by adding a row and shifting the row index from/to the model. But those classes are made to hide data from the model not add to it. So I'm having troubles with index management. I keep looking and I might ask a question about that later.
But right now, I would like your thoughts on the conception/patterns. Is this the right way to do it ? Do you have other ideas ?
Thanks,@Ch4rles said in Conception for a table with 1st row as a filter:
I would like your thoughts on the conception/patterns
Square peg, round hole? :) You'd be better doing it in the header. But admit I don't know how to, how much can you do with
QHeaderView
? -
Hi and welcome to devnet,
Do you mean you want to filter each column independently ?
-
You might want to use a technique similar to the one shown in the frozen column example.
-
You might want to use a technique similar to the one shown in the frozen column example.
-
Well here is what I came up with:
https://github.com/Ch4rle5/columnFilteredTableExample