this is the code
void MainWindow::on_pushButton_clicked() // I click and the quiery result is showing in the qtableview
{
QHash< int, QString> hash;
hash.insert(100, "Jackson");
model->setQuery("select city-codes from country");
ui->tableView->setModel(model);
}
void MainWindow::on_pushButton_clicked() // I click and the quiery result is showing in the qtableview
{
QSqlQueryModel * model = new QSqlQueryModel(0);
QHash< int, QString> hash;
hash.insert(100, "Jackson");
model->setQuery("select city-codes from country");
ui->tableView->setModel(model);
}
To copy to clipboard, switch view to plain text mode
Bookmarks