Try this:
Qt Code:
  1. #include <QCoreApplication>
  2. #include <QSqlDatabase>
  3. #include <QStringList>
  4. #include <QtDebug>
  5.  
  6. int main( int argc, char **argv )
  7. {
  8. QCoreApplication app( argc, argv );
  9. qDebug() << QSqlDatabase::drivers();
  10. }
To copy to clipboard, switch view to plain text mode 
it should print all available drivers (don't forget about QT += sql).

Make sure you create QCoreApplication or QApplication instance before you try to connect to the database.