aymenkn
27th March 2014, 19:20
Hello, I want selects the contents of a ComboBox, and DateEdit TimeEdit
This did not work
it displays only the mat field
QSqlQuery qry;
qry.prepare("select * from Etudiant");
if(qry.exec()){
while(qry.next()){
ui->lineEdit_matE->setText(qry.value(0).toString());
ui->comboBox_sexE->setCurrentIndex(qry.value(1).toInt());
ui->dateEdit_dateA->setDate(qry.value(2).toDate());
ui->timeEdit_heureA->setTime(qry.value(3).toTime());
}
This did not work
it displays only the mat field
QSqlQuery qry;
qry.prepare("select * from Etudiant");
if(qry.exec()){
while(qry.next()){
ui->lineEdit_matE->setText(qry.value(0).toString());
ui->comboBox_sexE->setCurrentIndex(qry.value(1).toInt());
ui->dateEdit_dateA->setDate(qry.value(2).toDate());
ui->timeEdit_heureA->setTime(qry.value(3).toTime());
}