求助帖:QT6使用addItem导致程序崩溃,求指点
ui->comboBoxbrand->clear(); QString sql = QString("select name from brand where factory = '%1'").arg(arg1); QSqlQuery query; query.exec(sql); while(query.next()) { QString name = query.value("name").toString(); ui->comboBoxbrand->addItem(name,Qt::DisplayRole); // }