PDA

View Full Version : making a change in an SQL table/qsqltablemodel appear in two qsqltableviews?



jtdavidson
13th July 2010, 03:40
At times a user of my application may have open two tableviews looking at the same underlying SQL table. Each tableview has its own QSqlTableModel.
If they edit data in one tablemodel, I would like that change to be immediately reflected in the other tableview at the same time. Is there a neat signal/slot way to do this? What is the most elegant way to go about it?

thanks

John

tbscope
13th July 2010, 05:36
The most elegant way is to use only one model for both views.

But, you could always update the other model when the first one changed. I guess you could just use select() again.