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
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.