0
選擇組合框的內容,並DateEdit TimeEdit 這不起作用 只顯示了墊場選擇估算組合框,日期等時間
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());
}
}
你在查詢中得到了正確的值嗎?嘗試在控制檯上輸出它們或使用調試器。 –