Insert column in a QTableView
General and Desktop
3
Posts
3
Posters
2.5k
Views
2
Watching
-
I'm using
QSqlTableModelalong withQTableViewand the model returns the columns and rows, for example:name,brand, how to insert a custom column between them onQTableView? For example:name,model,brand.Let me explain it better... only
nameandbrandis within the database, themodelis a custom column that I need to add between them, and it doesn't need to be saved on the database, because the value can alter in runtime. -
Hi,
You need a proxy model. Have a look a QAbstractProxyModel and QSortFilterProxyModel
-
I wrote such a proxy (generic insertion of extra columns). You can use it, assuming LGPL code is OK: