Home > other >  Qt QSqlTableModel data how to update
Qt QSqlTableModel data how to update

Time:03-10

Program is a multi-threaded programs, graphics world with a QTableView associated QSqlTableModel is used to display data in the database, and another thread may change the content database. The data is changed when QTableView displays content also needs to make corresponding change, change the database when I notice that thread can emit a signal QTableView updates, but I don't know how to update QTableView displays content, tried many methods are useless. Beg god to help solve, thank you!

CodePudding user response:

For the top

CodePudding user response:

Submit () database?

CodePudding user response:

QTableView: : show ()? Wait for Daniel to solve

CodePudding user response:

QSqlTableModel: : select () with the function,

CodePudding user response:

http://bbs.qter.org/forum.php? Mod=viewthread& Tid=186 & amp; Extra=page % 3 d1%26 filter % 3 dauthor % 26 orderby % 3 ddateline ddateline % 26 orderby % 3

CodePudding user response:

After each use database statements change database, called the model of submitAll (); ,
  • Related