Create mobile apps with Qt Creator
Easy Apps
Find out how to create a cross-platform app with the veteran tool Qt Creator.
Qt has been around for more than 20 years. During this time, developers have used several approaches to develop graphical interfaces. More specifically, you might recall Qt Widgets [1], Qt Quick [2], and Qt Quick Controls 2 [3]. Qt beginners who want to build mobile, cross-platform apps might perhaps be confused by this diversity, especially since all the technologies are still in use.
Qt runs on different platforms: Desktop, embedded, and mobile. For desktop applications (OS X, Windows, Linux), developers are more likely to go for Qt Widgets, which offers native controls for the user interface. In contrast, Qt Quick, based on an OpenGL implementation, seeks to abstract the UI controls to deploy Qt across platforms. Mobile apps developed with Qt Quick do not look native, nor is their performance very convincing. This changed, however, with Qt 5.7, which introduced the lightweight Qt Quick Controls 2. The name is a bit deceptive, because it is not a new version of Qt Quick, but a completely new development.
Mobile Controls
Qt Quick Controls 2 comes with many additional controls and with new containers that simplify development. Navigation elements, now standard in mobile applications, are also on board. Table 1 shows an overview of the elements provided by Qt Quick Controls 2.
Table 1
Qt Quick Controls 2
Containers | Others |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Buttons |
|
|
|
|
|
|
|
|
|
|
|
| Navigation |
Pop-Ups |
|
|
|
|
|
|
|
|
Currently, three styles of control elements are available: Google Material, Windows Universal, and Default – a special iOS style is due to follow. Qt also has a dark and a bright theme.
Producers
If you have worked exclusively with Eclipse for more than 10 years, the switch to Qt Creator [4] might not be easy. However, the software is well-suited to building mobile apps. It helps you program the business logic with C++ and create the interface with QML, thus supporting the deployment process on platforms such as Android, iOS, and Windows 10. Developers can test mobile apps on simulators or real devices from within Qt Creator and build releases for the app stores.
Qt Creator supports the complete Android build process with support for an Android Manifest Editor (Figure 1), signatures, and icons. This also works without Android Studio; however, developers do need to install an SDK and the NDK up front.
An Xcode project for iOS is created by calling Project | Archive and then loading the app into the store, but if you want to use Xcode, you need an Apple computer. The path to the Windows App Store is through a Visual Studio project.
One for All
The beauty of Qt is that it serves different platforms with the same source code, and it even has interfaces to supplement native code for Android and iOS.
For my QtCon Conference App [5], I wanted to find out what is possible with a plain vanilla Qt version. The result is available on GitHub [6], and if you are interested, you will also find it in the Google Play Store or the Apple App Store.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.