设置Qt依赖库路径
2017-02-28 14:41
1781 查看
在Qt5.0版本以后,由于框架的改动,打包的程序安装到其它电脑会提示找不到Qt库的路径, 这时候需要注册这些库,如下:
void Util::registerPluginsDir(QDir &exeDir) { QString pluginsRelPath = "qtplugins"; QString platformsRelPath = "platforms"; QString sqlDriversRelPath = "sqldrivers"; QString imageformatsRelPath = "imageformats"; QString pluginsPath = exeDir.absoluteFilePath(pluginsRelPath); QString platformsPath = QDir(pluginsPath).absoluteFilePath(platformsRelPath); QString sqlDriversPath = QDir(pluginsPath).absoluteFilePath(sqlDriversRelPath); QString imageformatsPath = QDir(pluginsPath).absoluteFilePath(imageformatsRelPath); QStringList pathes = QCoreApplication::libraryPaths(); pathes << pluginsPath; pathes << platformsPath; pathes << sqlDriversPath; pathes << imageformatsPath; QCoreApplication::setLibraryPaths(pathes); }
相关文章推荐
- QT设置openCV头文件和链接动态库路径
- Qt——路径设置问题
- qmake.exe是在Qt安装编译时生成的,里面内嵌了Qt相关的一些路径(最简单的方法是保持一样的安装路径,最方便的办法是设置qt.conf文件)
- qt 路径设置
- QT的pro文件编写,高效简洁,,路径设置 有空格 引入系统环境变量等
- Qt构建套件路径手动设置
- Qt—路径设置
- Qt 技巧:设置在 debug 路径下直接运行可执行文件
- VS2012设置通用路径和依赖项
- Vs + Qt 各种路径设置
- Qt配置信息设置(QSettings在不同平台下的使用路径)
- QT设置openCV头文件和链接动态库路径
- qt creator设置qmake路径(No valid Qt version set. Set one in Tools/Options)
- Qt 技巧:设置在 debug 路径下直接运行可执行文件
- Qt配置信息设置(QSettings在不同平台下的使用路径)
- qt设置路径为应用程序启动路径
- Linux下的QT的库路径设置和连接
- 记录我学Qt的点点滴滴(一、获取文件路径、设置字体、颜色)
- linux 发布 qt(更新ld命令的路径依赖)
- Qt for Symbian中如何添加头文件路径和打包文件|Qt 窗口外边框设置。