效果 思路 //获取文本框内容 QString NameAndNumber = ui->lineEdit_search->text(); //根据文本框内容查询数据库(全局模糊查询) QSqlQuery query; QString search = QString("SELECT * FROM staffInfo WHERE staffName LIKE '%%1%' " "or number LI