PDA

View Full Version : Personalize QSqlTableModel



BrainStorm
13th August 2010, 22:39
Hi everyone, my question is simple.
I have a QTableView with a QSqlTableModel as a model, and everything as usual, but i need to show a collum (category), witch is the id's of the category of the product, with the name of the category, not the id, so i need to do a lookup in the database but, how do I do this? i mean... how do a make the model or tableview show another stuff when it actually just load the whole table? i hope i made it clear enough, my english is very bad, yet. thanks in advance :)

Lykurg
13th August 2010, 22:50
If I understand you right, you are looking for QSqlRelationalTableModel.

BrainStorm
14th August 2010, 02:10
If I understand you right, you are looking for QSqlRelationalTableModel.

thanks very much! :D:D