Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Qt 5.1 apps for iOS

Tags:

c++

xcode

ios

qt

qt5

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?

like image 997
Mortennobel Avatar asked Jul 04 '13 19:07

Mortennobel


2 Answers

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
like image 66
Infinite Loop Avatar answered Nov 18 '22 19:11

Infinite Loop


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.

like image 27
user2230199 Avatar answered Nov 18 '22 18:11

user2230199