Double the column in QSqlTableModel
Hi , can you help me double the coumn in QSqlTableModel.
Table “User” have 2 column (Id, name) how i can set in my model to have 3 column (id,id, name)
coumn id is double
Its can by in QSqlTableModel or QSqlRelationalTableModel.
[edit: fixed typo in title, eddy]
So in that case you must have additional tables in order to make relationships to them but I think I see what you are wanting now.
It looks like QSqlRelationalTableModel will not do what you want on it’s own as it only uses the columns in the table that are already present. One way around this would be to create a view in your database that contains the replicated id column and then use this in your QSqlRelationalDatabaseModel.