try to read a sqlquery, save it into a qstringlist and set it to combobox.
pass compile but combobox is empty.
Qt Code:
QStringList cblist; QSqlQuery query; query.prepare("SELECT lastname FROM employeestuf"); query.exec(); while(query.next()) { if (query.isValid()) cblist<<query.value(0).toString(); } ui->comboBox->addItems(cblist);To copy to clipboard, switch view to plain text mode
Bookmarks