无法将Qt Quick应用程序部署到Mac OSX [英] Can't deploy Qt Quick app to Mac OSX

查看:407
本文介绍了无法将Qt Quick应用程序部署到Mac OSX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将应用程序部署到Mac OSX,但是它不起作用.

I'm trying to deploy an application to Mac OSX, but it doesn't work.

构建我的应用程序后,似乎运行良好,可以在Qt Creator中运行,我使用QML和C ++来构建该应用程序.我使用了命令行:

After build my app it seems to be working fine, running inside Qt Creator, I used QML and C++ to build the app. I've used the command line:

macdeployqt MyApp.app -dmg

此后,生成了.dmg文件,但其中的应用程序不起作用.它会打开一个空窗口.更糟糕的是,在部署应用程序执行后,我在Qt Creator中的应用程序也开始仅显示一个空窗口,显示以下输出:

After that a .dmg file is generated but the app inside that doesn't work. It opens an empty window. Worse than that, after deployed app execution also my app in Qt Creator starts to show only an empty window showing the following output:

qrc:/qml/main.qml:1:1:未安装模块"QtQuick"
qrc:/qml/main.qml:4:1:未安装模块"QtQuick.Controls"
qrc:/qml/main.qml:2:1:未安装模块"QtQuick.Dialogs"
qrc:/qml/main.qml:1:1:未安装模块"QtQuick"
qrc:/qml/main.qml:4:1:未安装模块"QtQuick.Controls"
qrc:/qml/main.qml:2:1:未安装模块"QtQuick.Dialogs"
qrc:/qml/main.qml:1:1:未安装模块"QtQuick"
qrc:/qml/main.qml:4:1:未安装模块"QtQuick.Controls"
qrc:/qml/main.qml:2:1:未安装模块"QtQuick.Dialogs"

qrc:/qml/main.qml:1:1: module "QtQuick" is not installed
qrc:/qml/main.qml:4:1: module "QtQuick.Controls" is not installed
qrc:/qml/main.qml:2:1: module "QtQuick.Dialogs" is not installed
qrc:/qml/main.qml:1:1: module "QtQuick" is not installed
qrc:/qml/main.qml:4:1: module "QtQuick.Controls" is not installed
qrc:/qml/main.qml:2:1: module "QtQuick.Dialogs" is not installed
qrc:/qml/main.qml:1:1: module "QtQuick" is not installed
qrc:/qml/main.qml:4:1: module "QtQuick.Controls" is not installed
qrc:/qml/main.qml:2:1: module "QtQuick.Dialogs" is not installed

otool -L向我显示了此信息:

@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (兼容版本5.2.0,当前版本5.2.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (兼容版本5.2.0,当前版本5.2.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (兼容版本1.0.0,当前版本1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL(兼容性 版本1.0.0,当前版本1.0.0)/usr/lib/libstdc++.6.dylib (兼容版本7.0.0,当前版本60.0.0)
/usr/lib/libSystem.B.dylib(兼容版本1.0.0,当前 版本1197.1.1)

@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.2.0, current version 5.2.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.2.0, current version 5.2.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

我已经删除了系统中所有的旧Qt库(或者,我想现在无法在其他任何地方找到Qt,只有5.2安装了). 任何人都对发生的事情有任何了解吗?

I've deleted all my old Qt libraries that I've in my system (or I suppose to, can't find Qt in anywhere else now, only the 5.2 installation). Anyone has any idea about what's happening?

推荐答案

我在Qt 5.0.1和Qt 5.1.0上遇到了同样的问题.为了修复它,我创建了自己的macdeployqt版本.我认为它将适用于Qt 5.2.0.请检查它: https://github.com/MaximAlien/macdeployqt .

I had the same problem with Qt 5.0.1 and Qt 5.1.0. To fix it I created my own version of macdeployqt. I think it'll work for Qt 5.2.0. Please check it: https://github.com/MaximAlien/macdeployqt.

这篇关于无法将Qt Quick应用程序部署到Mac OSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆