Hi,All
I'am using QSqlQueryModel ,but I am wondering how can I refresh the data inside it,
for example:
//
model->setQuery("SELECT name, salary FROM employee");
model->setHeaderData(0, Qt::Horizontal, tr("Name"));
model->setHeaderData(1, Qt::Horizontal, tr("Salary"));
view->setModel(model);
view->show();
QSqlQueryModel *model = new QSqlQueryModel;
model->setQuery("SELECT name, salary FROM employee");
model->setHeaderData(0, Qt::Horizontal, tr("Name"));
model->setHeaderData(1, Qt::Horizontal, tr("Salary"));
QTableView *view = new QTableView;
view->setModel(model);
view->show();
To copy to clipboard, switch view to plain text mode
//
if I insert a row into employee using another application,
how can i refresh the QSqlQueryModel?
Thanks.
Bookmarks