pro文件里面加上 QT += sql QStringList drivers = QSqlDatabase::drivers(); foreach(QString driver, drivers) { qDebug() << "\t" << driver; }