You can reimplement columnCount() and data() in either QSqlRelationalTableModel subclass or QSortFilterProxyModel subclass. If index passed to data() refers to a dynamic column you calculate data and return it, otherwise you call the base class implementation.
What about showing tooltips or a separate widget next to the view (a bit like in QColumnView)? A separate widget could even use QDataWidgetMapper to let user directly edit model data. I guess a popup dialog goes too but I like to avoid them myself.For achieving 2), I thought that a QDialog could arise when the user double-clicks onto a given row. That QDialog would contain the "extended" information, and let the user modify it, so this idea would also accomplish 3)
You can reimplement QSortFilterProxyModel::filterAcceptsRow() to apply custom filtering.Last, for 4) I want to let the user decide if he wants to search in one of three posible manners, selectable by three exclusive radio buttons:
* Name + surname1 + surname2
* Member num
* Member id
The problem, is that QSortFilterProxyModel can only search one column at a time, or all of them, but there is no intermediate option. So what would be the best way of doing a search which affects 3 (or an arbitrary number of) columns?
Bookmarks