This blog series is about the new Qt Quick Controls 2 to develop mobile apps for Android and iOS.
Besides Qt 5.8 you’ll also get a new Qt Creator 4.2.1
Perhaps you already have an older version of Qt already installed, you can use the Maintenance Tool to update. I’m always doing a fresh install for each Beta, RC or Release.
Before downloading and installing you should know if you want to install the Open Source or Commercial version of Qt for Application Development.
Please take a look at Qt FAQ‘s and also my blog post about licensing and the new license for small Startups and Independent Developers.
I’m using the Commercial version for Startups – see Qt’s offer here: https://www.qt.io/start-up-plan/
Read more about Open Source vs Commercial also in my blog about ‘Install Qt 5.6‘
Here are my steps to download and install Qt 5.8
Install Qt 5.8
Go to your Qt Account – Downloads and select the Qt Online Installer:
See available downloads:
I selected the macOS online installer:
Here’s my download on OSX:
Double click to install:
Log into your Account:
Select the folder where to install:
It’s a good idea to use installation pathes without spaces. see also here.
As next select your components:
please notice: some components from commercial are now included into the open source part.
and wait for the installer:
If Installer finished, I’m not launching Qt Creator yet.
Start Qt Creator with -settingsPath
All Qt Creator instances by default share the settings. Having the new Qt Creator 4.2.1 and old 4.0.2, 3.6.2 using the same settings is no good idea. Also I want to use different working directories for my Qt 5.6, 5.7 and the new Qt 5.8 Release.
You can start Qt Creator with parameter -settingsPath – here’s HowTo do this from OSX:
Search for the Qt Creator.app from Qt 5.8 and do a right-click on the app. Here’s the content:
rename Qt Creator to something like Qt Creator-bin:
From a Text Editor create a Script to execute the Qt Creator-bin with a parameter.
something like this:
#!/bin/sh exec "/daten/_qt_sdks/sdk_580/Qt Creator.app/Contents/MacOS/Qt Creator-bin" -settingspath /daten/_qt_sdks/sdk_580/qtc_settings "$@"
Save this file named “Qt Creator” besides the Qt Creator-bin:_
Now you can start Qt Creator, which will execute the script:
Qt Creator will create the QtProject folder to sthore all the configuration settings.
Now you can start multiple Qt Creator versions without any collision.
Qt Creator 4.2.1
At first I’m changing QtCreator’s language on my german MacBookPro to english and restart
Select your Theme. I’m using the Flat Theme:
Qt Creator Preferences Working Directory
Set your working directory for 5.8, if you are using different directories as I’m doing:
Qt Creator Preferences Android
Take a look at your Devcies -> Android preferences:
Select your SDK and NDK locations and check ‘Gradle’:
Important: Don’t use a newer NDK ! Please always use r10e because of some trouble with the newer ones.
Qt Creator External Tools
I’m developing business apps and business apps always need support of languages (i18n). Configuring the External Tools for Linguist (Qt’s Tool to translate text from your QML and C++ sources) will make it more comfortable.
As first step we’ll add the Linguist App.You’ll find the Linguist at 5.8 –> clang_64 –> bin:
(similar screenshots from 5.-7)
I like to use Tools in english, but the language cannot be changed yet for Linguist, so the trick is to rename the translations file, which in my case is 5.8 –> clang_64 –> translations –> linguist_de.qm:
Under Preferences –> Environment –> External Tools there already exist access to commands for lupdate and lrelease. (lupdate is looking for the strings you marked as translatable and to create or update the translation files <app>.ts. Using Linguist or external tools you can then translate the strings. lrelease compiles these translations from *.ts into *.qm. Only *.qml files will be deployed to your device)
I found out that the default configuration doesn’t work on Android and iOS – please use the executable from …/5.8/clang_64/bin:
(similar screenshots from 5.7)
Test if Linguist will start. From External Tools
Linguist should start:
it’s a good idea to use a shortcut:
Verify Installation: Gallery Qt Quick Controls 2
As last step verify if all is correct configured.
Best way to do this and to get a first impression of new QtQuick Controls 2 is to run the Quick Controls 2 Gallery App.
From Overview – Examples search for “Gallery” and select the right one:
Configure your project for Android / iOS. Even if you only develop mobile apps it’s a good idea also to check the ‘Desktop’. Most mobile apps also run on OSX and the build-run-cycle is much faster- (Thx @jpnurmi for this tip – saved me much time)
Now run on your device(s).
Select your Device – here’s my BlackBerry PRIV (Android 6.0.1):
… and the Gallery App is running:
Congrats – you have installed Qt 5.8. Now you can try out all the new Controls.
Patches / Bugs
ATTENTION: There’s a critical bug using some controls on Android 6 or Android 7: QTBUG-59026
Also there’s a bug with Ripple Effect in Drawer on Android and iOS: QTBUG-59293
Fortunately Qt is Open Source 🙂 With some help by @jpnurmi here are some patches to make it run:
If you already have projects using Qt 5.7 – take a look what’s good to know if moving projects from 5.7 to 5.8
New to Qt for mobile ? Here are some more appetizers:
Clone my Examples from Github and Run
Please follow my blog series: https://appbus.wordpress.com/category/qt-for-mobile/overview/