xcode 为 iOS 创建 Qt 5.1 应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17477165/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Creating Qt 5.1 apps for iOS
提问by Mortennobel
The new Qt 5.1 has (partial) support for iOS as mentioned in the release announcement, but how do I actually build and deploy a Qt project to a iOS device? Or in other words, how do I end up with a iOS XCode project?
如发布公告中所述,新的 Qt 5.1(部分)支持 iOS ,但我如何实际构建 Qt 项目并将其部署到 iOS 设备?或者换句话说,我如何最终得到一个 iOS XCode 项目?
回答by Infinite Loop
This shows how to compile qt5 for the iOS simulator.
这显示了如何为 iOS 模拟器编译 qt5。
Based on qt build instructions for iOS.
If you want to build for an iOS device, you have to check out the qt5 sources a second time to a second directory and use the alternate configure command as shown below.
如果你想为 iOS 设备构建,你必须再次检查 qt5 源到第二个目录并使用备用配置命令,如下所示。
This uses qt 5.2 beta 1. Check for newer versions with git tag
.
这使用 qt 5.2 beta 1。检查更新的版本git tag
。
git clone git://gitorious.org/qt/qt5.git qt5-ios-simulator.git
cd qt5-ios-simulator.git
git tag
git reset --hard v5.2.0-beta1
Initialize qt but do not use webkit because it takes too long to compile
初始化qt但不要使用webkit,因为编译时间太长
perl init-repository --no-webkit
Configure qt to use open source version with simulator, skipping examples and test
配置qt以使用带有模拟器的开源版本,跳过示例并测试
./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests -sdk iphonesimulator
Alternatively, use this configure command in a separate git checkout to build for iOS devices
或者,在单独的 git checkout 中使用此配置命令为 iOS 设备构建
./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests
Run make. Uses 4 jobs in parallel for faster compilation.
运行制作。并行使用 4 个作业以加快编译速度。
make -j 4
cd ..
Done.
完毕。
You may test if everything works by building an example project
您可以通过构建示例项目来测试一切是否正常
git clone https://github.com/msorvig/qt-ios-demo.git
cd qt-ios-demo
../qt5-ios-simulator.git/qtbase/bin/qmake
open qt-ios-demo.xcodeproj
回答by user2230199
I have not tried it myself yet but I would guess have to install XCode and Qt Creator on your OSX. As I know the Qt guys its probably like the Android version. Just try to install the Qt SDK with the online installer and select the iOS version. The rest should be possible in QtCreator. I would be interested to know if it worked.
我自己还没有尝试过,但我想必须在你的 OSX 上安装 XCode 和 Qt Creator。据我所知,Qt 人员可能喜欢 Android 版本。只需尝试使用在线安装程序安装 Qt SDK 并选择 iOS 版本即可。其余的应该在 QtCreator 中是可能的。我很想知道它是否有效。