Hello everyone,
I,am newbie,
I have a MainWindow with several lineEdits calling: leMateriaal, leDin_norm etc..
I have a searchDialog with comboboxen calling: materiaalComboBox, dinCombobox etc..
I have a connection with a extern database with several rows of input.
If i pop-up my searchDialog in the MainWindow en choose in the combox of the searchDialog the currentText() en push the button ok the seachDialog must be searching in the database for the chosen items en show them in the MainWindow lineEdits.
The problem is i try several options but nothing works.
The first option was QSqlTableModel:
In the MainWindow i only see the first record not the the item i choose in my searchDialog combobox.Qt Code:
void MainWindow::search() { searchDialog dlg(this) QSqltableModel model; model.setTable("frezen"); model.select(); leMateriaal->setText(mat); leDin->setText(din); } }To copy to clipboard, switch view to plain text mode
My second option was the same with QSqlQueryModel.
Is it possible when i choose items in the comboboxen in the searchDialog then searchDialog searching in the database en put the items in my MainWindow lineEdits.
Is something missing in my code?
Bookmarks