Hello,
I am from brazil.
i am with a problem on the QTableView, when i put a model of the a Connection, not refresh...
code:
QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
db.setHostName("localhost");
db.setDatabaseName("alan");
db.setUserName("postgres");
db.setPassword("351321");
bool ok = db.open();
QSqlTableModel *model = new QSqlTableModel(this,db);
model->setTable("tbproduto");
model->select();
model->setHeaderData(0, Qt::Horizontal, QObject::tr("Codigo do Produto"));
model->setHeaderData(1, Qt::Horizontal, QObject::tr("Produto"));
ui.Grade->setModel(model);
ui.Grade->show();
...
Bookmarks