为iOS创建Qt 5.1应用程序

新的Qt 5.1对发布公告中提到的iOS(部分)支持,但我如何实际构建和部署Qt项目到iOS设备? 或者换句话说,我如何最终得到iOS XCode项目?

这显示了如何为iOS模拟器编译qt5。

基于iOS的qt构建说明 。

如果要为iOS设备构建,则必须再次将qt5源检出到第二个目录,并使用alternate configure命令,如下所示。

这使用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 

初始化qt但不使用webkit,因为编译需要很长时间

 perl init-repository --no-webkit 

配置qt以使用带模拟器的开源版本,跳过示例和测试

 ./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests -sdk iphonesimulator 

或者,在单独的git checkout中使用此configure命令为iOS设备构建

 ./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests 

运行make。 并行使用4个作业以加快编译速度。

 make -j 4 cd .. 

完成。

您可以通过构建示例项目来测试一切是否正常

 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 

我自己还没试过,但我猜想要在你的OSX上安装XCode和Qt Creator。 据我所知,Qt的人可能就像Android版本一样。 只需尝试使用在线安装程序安装Qt SDK并选择iOS版本。 其余应该可以在QtCreator中实现。 我很想知道它是否有效。

Interesting Posts