解决方案:QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

在用QSqlDatabase时遇到报错QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins是因为Qt不知道plugins的所在目录。


解决方法:

在用到数据库之前添加代码QCoreApplication::addLibraryPath("./plugins");

其中的"./plugins"可以替换为实际plugins所在的目录(plugins下级存在sqldrivers目录,该目录下的dll为QSqlDatabase实际需要的library。

解决方案:QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins,布布扣,bubuko.com

解决方案:QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

上一篇:解决:Android4.3锁屏界面Emergency calls only - China Unicom与EMERGENCY CALL语义重复


下一篇:IOS读写Plist文件最简单方法