macdeployqt不复制插件 [英] macdeployqt not copying plugins
问题描述
我正在开发一个基于Qt的应用程序,当我在捆绑包上使用macdeployqt时,不会将Qt插件复制到捆绑包中。
运行它第二次,他们是。此外,如果应用程序使用QtSvg模块,则部署svg图标插件。没有完全填充 - 我的应用程序确实使用QtSvg但是没有复制iconengines / *插件。
我试过用-verbose = 3运行它,最后几行:
日志:创建的配置文件:silverlock.app/Contents/Resources/qt.conf
日志:此文件将插件搜索路径设置为silverlock.app/Contents/PlugIns
消息说,它似乎是打算继续运行,但没有 - 几乎就像它崩溃了。
为什么会发生这种情况?
- Qt 4.6
- Qt Creator 2.0
- Leopard 10.5.8
问题在于macdeployqt源代码中sharedfpp的第355-365行:
while(frameworks.isEmpty()== false){
const FrameworkInfo framework = frameworks.takeFirst();
copiedFrameworks.append(framework.frameworkName);
//从其中一个Qt框架获取qt路径;
if(deploymenInfo.qtPath.isNull()&&& framework.frameworkName.contains(Qt)
&&& framework.frameworkDirectory.contains(/ lib))
{
deploymenInfo.qtPath = framework.frameworkDirectory;
deploymenInfo.qtPath.chop(5); // remove/ lib /
}
您的第一个框架/ dylib名称在其名称中具有Qt的包被用于确定插件路径。因为我的包中的第一个框架/ dylib名称是QtSolutions_QtSingleApplication-2.6...你得到的图片。所以我想一个解决方法是重命名dylib为qsa-2.6.dylib或某事。
简而言之:确保您的框架和库名称不在其中有Qt或者你遇到与macdeployqt的问题。
希望这个答案可能帮助有同样问题的人。
I'm developing a Qt-based application and when I use macdeployqt on the bundle, the Qt plugins are not copied to the bundle.
However, if I run it a second time, they are. Additionally, "The svg icon plugin is deployed if the application uses the QtSvg module." is not fullfilled - my application does use QtSvg but the iconengines/* plugin is not copied.
I tried running it with -verbose=3, and the last couple lines are:
Log: Created configuration file: "silverlock.app/Contents/Resources/qt.conf"
Log: This file sets the plugin search path to "silverlock.app/Contents/PlugIns"
From what the last message says, it kind of seems that it intended to continue running, but didn't - almost as if it crashed.
Why is this happening? macdeployqt has worked for me before without issue.
Using:
- Qt 4.6
- Qt Creator 2.0
- Leopard 10.5.8
The problem lies at lines 355-365 of shared.cpp in the macdeployqt source:
while (frameworks.isEmpty() == false) {
const FrameworkInfo framework = frameworks.takeFirst();
copiedFrameworks.append(framework.frameworkName);
// Get the qt path from one of the Qt frameworks;
if (deploymenInfo.qtPath.isNull() && framework.frameworkName.contains("Qt")
&& framework.frameworkDirectory.contains("/lib"))
{
deploymenInfo.qtPath = framework.frameworkDirectory;
deploymenInfo.qtPath.chop(5); // remove "/lib/"
}
The first framework/dylib name in your bundle that has "Qt" in its name is taken to determine the plugin path. Since the first framework/dylib name in my bundle was "QtSolutions_QtSingleApplication-2.6"... you get the picture. So I suppose a workaround is to rename the dylib to "qsa-2.6.dylib" or something.
In a nutshell: make sure your framework and library names don't have "Qt" in them or you'll run into issues with macdeployqt.
Hopefully this answer may help someone having the same issue.
这篇关于macdeployqt不复制插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!