QSqlQueryModel return from Function outside [solved]
General and Desktop
9
Posts
2
Posters
1.9k
Views
1
Watching
-
Hello,
i have a problem with this funktion. The Funktion load the completly Database but i dont know how can return the model
@MainWindow main;
QSqlQuery *qry = new QSqlQuery(main.mydb1);
QSqlQueryModel *model = new QSqlQueryModel();
qry->prepare("select * from "+tableName+"");
if(qry->exec())
{
model->setQuery(*qry);
}@When i do this in another Programm i can the Model view in tableView with ui->tableView->setModel(model) but not in a function outside from the code. Or can i set the tableView in the function?
I hope my englisch is good to understand my problem.Bye
Alex from Germany