Qt for iOS

Qt's iOS port allows you to run Qt applications on iOS devices, such as iPhones and iPads.

Getting Started

Development and deployment is done using Xcode. The supported workflow is to maintain a .pro file based project, export it to Xcode (and re-export when the project setup changes), and then build and deploy using Xcode. We will look at that in more detail in the next section.

The minimum deployment target for Qt applications is iOS 5.0. Qt then supports the following devices (iOS might need to be upgraded on some devices).

  • iPhone 3GS and later
  • iPod Touch third and later generations
  • iPad 2 and later
  • iPad Mini

Setting Up the Development Environment

We assume that you have cloned the Qt 5 repositories (or obtained the Qt sources elsewhere) and followed the platform independent requirements for building Qt. The requirements are described here.

You continue by installing Xcode. You will find it in the App Store. For running Qt applications in the simulator that comes with Xcode, this is all you need. However, for running applications on a device and publishing your applications in the App Store, you must join the iOS Developer Program, see https://developer.apple.com/programs/ios/ for further information.

After testing that Xcode is set up correctly, for example, by running one of the standard Xcode app templates, we can build Qt. This is done from the Qt 5 top directory, like so:

> ./configure -xplatform macx-ios-clang -developer-build -release

It is currently not possible with a single build for use with both the simulator and devices. If you want to build for the simulator, use the -sdk argument.

> ./configure -xplatform macx-ios-clang -developer-build -release -sdk iphonesimulator

Then simply run make.

Building Applications

As mentioned previously, the development workflow on iOS consists of maintaining a normal .pro file project and export it to Xcode. Here is how to build a project:

  • run qmake (if you have not done so previously)
  • open the resulting .xcodeproject file in Xcode
  • build the application in Xcode

Note that you must re-import the project if its setup changes, for example, when adding or removing source files.