PDA

View Full Version : Custom SQL in QSqlTableModel/QTableView



estanisgeyer
1st February 2008, 12:11
Good day, lords of the QT's!

I'm using QSqlTableModel and QTableView, I wonder: this is the best way whether custom the SQL, making select between two or more tables? Can use submitAll? I think not, what can I do?

Thanks,

Marcelo E. Geyer

wysota
1st February 2008, 12:15
Use QSqlQueryModel or QSqlRelationalTableModel if the main table contains foreign keys to other tables and you simply want to subsitute them with a column from a related table.

Note that QSqlQueryModel is a read-only model.

estanisgeyer
1st February 2008, 12:23
Sure, QSqlQueryModel can not use because I will need to change the information. I still I have a QSpinBox (not delegate), which put the value in a certain field. Any suggestions?

wysota
1st February 2008, 13:18
Have a look at QDataWidgetMapper.