求助帖: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);
            //
        }

 

posted @ 2024-08-04 21:03  文姬的九命猫  阅读(4)  评论(0编辑  收藏  举报