QString detectShowID, detectShowTime, detectShowClassFirst, detectShowClassSecond;
QString sqlShowQuery;
sqlShowQuery = "select abres_time, abres_first, abres_second from abnordetectresult where detect_id = '" + dataGet + "'";
QSqlQuery showQuery;
showQuery.exec(sqlShowQuery);
while (showQuery.next())
{
detectShowTime = showQuery.value(0).toString();
detectShowClassFirst = showQuery.value(1).toString();
detectShowClassSecond = showQuery.value(2).toString();
}
ui.label_detectid->setText(dataGet);
ui.label_detecttime->setText(detectShowTime);
ui.label_class1res->setText(detectShowClassFirst);
ui.label_class2res->setText(detectShowClassSecond);
qt从数据库中读值显示在label上
最新推荐文章于 2024-06-02 17:38:53 发布