You can use QPluginLoader
to get some better error message.
When I had the same problem with the MySQL driver the message was something like "The version was compiled with other options than this Qt version".
It seemed like the Qt sources, that shipped with the Qt SDK at that time, were not compatible with its binaries.
After downloading the Qt sources and compiling my own version of Qt and the MySQL driver, the problem was gone.
EDIT: Some sample code.
QPluginLoader loader;
loader.setFileName("/Users/niklaswulf/QtSDK/Qt/4.8.4/plugins/sqldrivers/libqsqlite_debug.dylib");
qDebug() << loader.load();
qDebug() << loader.errorString();
loader.setFileName("/Users/niklaswulf/QtSDK/Qt/5.0.1/5.0.1/clang_64/plugins/sqldrivers/libqsqlite_debug.dylib");
qDebug() << loader.load();
qDebug() << loader.errorString();
When compiling against 5.0.1 this is the output:
false
"The file '/Users/niklaswulf/QtSDK/Qt/4.8.4/plugins/sqldrivers/libqsqlite_debug.dylib' is not a valid Qt plugin."
true
"Unknown error"
I also found the old message:
The plugin '/path/to/some/libqsqlmysql.dylib' uses incompatible Qt library. Expected build key "macosx macx-cocoa g++-4 full-config", got "macosx macx-cocoa g++-4 no-pkg-config"