Hi all, I'm doing a small database application and would like to ask if I'm doing well:
1) The user should see some of the data stored in the table "members". This table contains a lot of details but the most interesting ones are "member num", "name", "surname 1", "surname 2" and "member id". Besides this 5, the user should see 2 more, generated at runtime from the "less-interesting" details (like for example, calculating the time between two periods of time).
2) The user should be able to view extra information of the members, including again some that is not contained directly in the table, but generated from the data at runtime.
3) Is the user sees any erroneus field he should be able to correct it.
4) It should be possible to search.
For achieving this, I'm using a QSqlRelationalTableModel, "assigned" to a QSortFilterProxyModel and this one viewed in a QTableView.
My first doubt is about 1), because it seems that I cannot add dynamic columns, just hide or show the ones existing in the database. So, is SqlRelationalTableModel a bad selection for my purposes?
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)
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?
Any ideas, opinions and corrections about how to do this would be appreciated;
thanks for reading
Bookmarks