为iOS创建Qt 5.1应用程序 [英] Creating Qt 5.1 apps for iOS

查看:173
本文介绍了为iOS创建Qt 5.1应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的Qt 5.1(部分)支援iOS,如发布公告,但是如何实际构建和部署一个Qt项目到iOS设备?

解决方案

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



基于 qt



如果您想为iOS设备构建,您必须再次检出qt5源码到第二个目录,请使用备用配置命令,如下所示。



这使用qt 5.2 beta 1.使用 git标签检查更新版本

  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因为编译需要太长时间。

  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


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?

解决方案

This shows how to compile qt5 for the iOS simulator.

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.

This uses qt 5.2 beta 1. Check for newer versions with 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

perl init-repository --no-webkit

Configure qt to use open source version with simulator, skipping examples and test

./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

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

Run make. Uses 4 jobs in parallel for faster compilation.

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

这篇关于为iOS创建Qt 5.1应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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