This is part of a continuing series of blogs of my experience using pyqtdeploy.
You might want to start at the tutorial which I link at the bottom of the blog. This blog really adds nothing except some discussion of why and how to get the required tools, and some context for pyqtdeploy.
Here, I have switched host development platform (now MacOS or OSX) and target (now iOS.)I switched because I encountered difficulties porting to Android. I decided to digress, in hopes that what I learn on a different target (iOS instead of Android) might teach me something. Besides, MacOS has always been a highly regarded development platform, and many pyqtdeploy example screenshots seem to be from MacOS. If you are using pyqtdeploy, then you probably want to port to all supported platforms, and you should choose the path of least resistance. There is no use struggling with one platform (Android) especially if, like me, you are equally unfamiliar with all the mobile platforms or if one platform (iOS) might be better supported, more stable, etc.
The process has three parts:
- set up tools
- compile libraries statically
- compile your app
This is part one, setting up tools.
The goal is to get a Qt example app running on iOS. Getting an example to run is not required to use pyqtdeploy. It is just a milestone, that insures you have a proper build environment. Hello world.
This blog assumes you want point-and-click. You can use Xcode and Qt Creator tools from the command line, without using their GUI’s. During the second part, you WILL be using the command line to build static libraries. But you probably would not be reading this if you already know the commands. And learning the GUI versions of the tools may guide you.
- Qt Creator
Pyqtdeploy uses qmake, which is packaged with Qt Creator. (Again, later, you might be able to forego Qt Creator, and use the command line.)
Qt Creator and qmake invoke tools (compilers etc.) that are packaged with Xcode.
Which versions of tools
- OSX 10.9.4 Mavericks
- Xcode 5.1.1
- Qt Creator 3.1.1
Downloading the tools
The links are easy to find.
My advice is to download the entire Xcode (rather than say just the command line tools.)
My advice is to use the “online installer” to install Qt and its tools. It is a small, smart installer that downloads and installs other components. It will know your platform and offer you choices to download the proper kits for iOS.
Installing additional Qt components
I think I had installed Qt without using the online installer. It did not include kits for iOS. So I needed to install additional Qt components.
About Qt Creator kits
The Qt Creator documentation about Adding Kits tells you how to add kits in Qt Creator. Restating….
Kits are groups of settings for building apps. You usually don’t need to create or customize a kit, only use a kit that is distributed with Qt.
When you open a project, including the Qt examples, you are given the chance to configure the kit for the project. But you must have previously downloaded the kit (which Qt Creator then detects.)
In this example, I wanted the kit for the ‘iOS Simulator.’
Downloading additional kits
You use the Qt ‘Maintenance Tool’ and choose ‘Package Manager’. If you previously used the Qt ‘online installer’, then when you start the Maintenance Tool it remembers the repository used previously, and gives you choices of additional packages.
Otherwise, you might get an error ‘requires a valid repository’. This is discussed in the Qt Forums. To fix this:
- start the Maintenance tool
- choose the Settings button, a dialog should open
- choose the Repositories tab
- select ‘User specified’
- choose the Add button
- enter http://download.qt-project.org/online/qt5/mac/x86/online_repository
and so forth. After you do this, the Maintenance Tool should offer you the choice of downloading additional kits.
Building a Qt example
Follow this good, short video tutorial “Qt5 Tutorial: Pushing Example App to iOS Simulator”. The analog clock example (without menus) worked for me.
The next part will build static libraries for Python, PyQt, and SIP, for the iOS platform.