Anyone de­vel­op­ing ap­plic­a­tions knows how complex it is to create and structure the in­di­vidu­al com­pon­ents. Therefore, libraries and frame­works with their ready-to-use com­pon­ents play an important role. These not only help with the stand­ard­isa­tion of the de­vel­op­ment process, but they also simplify it. The cross-platform framework Qt, for example, saves a great deal of work in the de­vel­op­ment of graphic user in­ter­faces and whole programs, where par­tic­u­larly a smooth co­oper­a­tion between designers and de­velopers is the focus. Com­pon­ents such as the in­teg­rated de­vel­op­ment en­vir­on­ment Qt Creator, ensure it has its own markup language here, as well as various freely se­lect­able modules.

What is Qt?

Dis­sat­is­fied with the tools for cross-platform software de­vel­op­ment, the two Nor­we­gi­ans Haavard Nord and Eirik Chambe-Eng began to develop Qt in 1990. Two years later they founded the company Trolltech, which was taken over by the tele­com­mu­nic­a­tions company Nokia, and in 2012 by the Finnish software company Digia. The Digia sub­si­di­ary, The Qt Company, has been re­spons­ible for de­vel­op­ment since 2014.

Over the years, Qt has developed from a simple class library into an extensive framework, which has gone through many changes to the license model. The current dual license system, which gives the user the choice between a pro­pri­et­ary license and the open-source licenses, GPL and LGPL, makes non-com­mer­cial as well as com­mer­cial use possible.

Qt is pro­grammed in C++, where the pro­gram­ming language is extended by the pre-processor MOC (meta-object compiler) with features such as the ele­ment­ary signal and slot mechanism (enables event-con­trolled com­mu­nic­a­tion between program objects). To do this, the pre-processor generates C++ con­form­ing to the standard from the Qt source code, even before compiling, which means Qt ap­plic­a­tions with current C++ compilers such as GCC, ICC, MinGW or MSVC can be trans­lated. Newer versions of the framework also offer access to the Qt’s own markup language QML, which ensures sim­pli­fic­a­tions, par­tic­u­larly with GUI de­vel­op­ment. Aside from these internal language solutions, there are various con­nectiv­it­ies supplied by third party providers for other program languages such as Python, Ruby, Go, Java and PHP.

With qmake (standard solution) and Qbs (Qt Build Suite) the framework holds two of its own build-systems, where other systems such as CMake can also be used. Users also have their own in­teg­rated de­vel­op­ment en­vir­on­ment, Qt Creator, which has a code editor among other things, and enables quick access to selected com­pon­ents.

A summary of the most important Qt com­pon­ents

Over time, the Qt framework has become in­creas­ingly extensive. Work has not only been carried out in­tens­ively on the quality of the in­teg­rated Qt Creator de­vel­op­ment en­vir­on­ment, as well as on the language and platform support, but also on providing pro­gram­mers and designers with as wide a range of features as possible. The Qt team pri­or­it­ises covering specific ap­plic­a­tion scenarios from the desktop, as well as the mobile sector.

As only very few ap­plic­a­tions based on Qt rely on the complete range of features, the framework has been divided into modules which can be freely selected and put together since Version 4. This ensures a high degree of flex­ib­il­ity for the Qt team, as well as the users during de­vel­op­ment. In Version 5, the Qt team in­tro­duced an ad­di­tion­al dif­fer­en­ti­ation for the module in the basic module (Qt Es­sen­tials) and the ad­di­tion­al module for special usage purposes (Qt add-ons).

Qt Es­sen­tials

Qt Es­sen­tials form the basis of Qt cross-platform. They are available on all supported de­vel­op­ment platforms as well as on all tested target platforms, and are relevant or useful for the majority of ap­plic­a­tions developed. The following modules are among the essential com­pon­ents of the framework:

Module De­scrip­tion
Qt core Non-graphic core classes that were not required by all other modules
Qt GUI Basic classes for the design of graphic user in­ter­faces; includes OpenGL
Qt Mul­ti­me­dia set of QML types and C++ classes for the pro­cessing of mul­ti­me­dia content (audio/video); APIs for access to camera and radio func­tion­al­ity
Qt mul­ti­me­dia widgets Classes based on widgets for im­ple­ment­ing mul­ti­me­dia func­tion­al­ity
Qt Network APIs for ap­plic­a­tions rely on TCP/IP networks
Qt QML Framework and types of Qt QML markup language
Qt Quick De­clar­at­ive framework for the de­vel­op­ment of highly dynamic ap­plic­a­tions with cus­tom­ised QML user in­ter­faces
Qt Quick Controls 2 Qt quick extension: Light­weight, very efficient QML types that simplify the interface for­mu­la­tion
Qt Quick Dialogs Qt quick extension: Types for creation and in­ter­ac­tion with system dialogs
Qt Quick Layouts Qt quick extension: QML types for the layout of objects in the interface developed
Qt Quick Test Test framework for QML ap­plic­a­tions; the test cases are described as JavaS­cript functions
Qt SQL Classes for the in­teg­ra­tion of SQL databases
Qt Test Classes for detailed tests of Qt ap­plic­a­tions and libraries
Qt widgets Set of UI elements to create classic user in­ter­faces based on widgets with Qt Designer

The model that is deployed differs, as mentioned, from ap­plic­a­tion to ap­plic­a­tion. What is crucial to consider for each project is the re­quire­ments it must fulfil. However, in some cases, the tools you want to work with are also relevant: The Qt modules Core and Qt GUI are therefore in­teg­rated as standard if you want to work with qmake. If you select Qbs or another solution as a build system, such a pre­defined de­pend­ency does not exist.

When designing graphic user in­ter­faces, Qt also offers two different options that influence the choice of core module: On the one hand, Qt Designer, a WYSIWYG editor that is closely as­so­ci­ated with the Qt widgets. On the other hand, the al­tern­at­ive Qt Quick (including various extending modules), which enables de­vel­op­ment with the QML language.

Qt add-ons

With the label ‘Qt add-ons’ all modules are provided, which give users of Qt an ad­di­tion­al use for specific purposes. While some of these ad­di­tion­al modules such as the core module are designed for all supported de­vel­op­ment and target platforms, the majority of these com­pon­ents can only be used on certain platforms. The add-on Qt Bluetooth therefore only works by ensuring access to Bluetooth hardware, for example, only in Android, iOS, Linux and macOS ap­plic­a­tions; modules such as Qt Windows Extras, Qt Mac Extras or Qt Android Extras only work in programs for the cor­res­pond­ing target platforms.

There are also three add-ons, which are only available under the com­mer­cial license or under the GNU-GPLv3 license:

  • Qt Charts: UI com­pon­ents for dis­play­ing optically appealing diagrams (based on static or dynamic data models)
  • Qt Data visu­al­isa­tion: UI com­pon­ents for 3D visu­al­isa­tion of data
  • Qt virtual keyboard: Framework for im­ple­ment­ing different entry methods as well as virtual keyboards based on QML (target platforms: Linux and Windows)
Note

After Qt 5, special ad­di­tion­al models (“value added modules”) have existed, which are only available when using the com­mer­cial license. This includes, for example, the module Qt for auto­ma­tion, which comprises different libraries and tools from auto­ma­tion systems such as KNX (building auto­ma­tion).

Qt Creator

The in­teg­rated de­vel­op­ment en­vir­on­ment (IDE) Qt Creator supplies you with numerous tools and auto­ma­tion mech­an­isms through­out the entire de­vel­op­ment process. A set-up manager therefore helps with the creation of a new project by leading you through the set-up process step by step and auto­mat­ic­ally creating all the computer files required. The IDE also speeds up the code writing. The in­teg­rated editor offers features for this, among other things, such as high­light­ing syntax, automatic code com­ple­tion and error checking.

Note

Binary packages in­stalling Qt Creator (included in the Qt download) are available for the Windows operating system (from 7), Ubuntu Linux (from 16.04), and macOS (from 10.10).

The following tools are also in­teg­rated as standard into Qt Creator in addition to the code editor:

  • qmake: As a standard build system of Qt, qmake is in­teg­rated directly into Qt Creator and can be selected in the project menu. However, other systems can also be exported into the IDE. To use Qbs, simply open a .qbs file, for example.
  • Qt Designer: Qt Designer is the native program for designing and creating graphic user in­ter­faces with the help of Qt widgets. The visual editor enables widgets to be put together and adapted as required.
  • Qt Linguist: Ap­plic­a­tions can be localised lin­guist­ic­ally directly in Qt Creator. De­velopers, trans­lat­ors and release managers will discover a suitable tool here in each case.
  • Qt Assistant: With Qt Assistant, Qt Creator provides quick access to the official doc­u­ment­a­tion of the framework. There is a help function for this.

Software de­vel­op­ment therefore works with signals and slots in Qt

Thanks to the con­nec­tions to Python, Ruby, Go, etc. Qt supports various languages. The native pro­gram­ming language of the framework remains C++ in any case, and the extension of this object-ori­ent­ated language with the MOC pre-processor ensures some new aspects and paradigms such as the signals and slots already mentioned. The concept enables event-con­trolled com­mu­nic­a­tion between program com­pon­ents used, and rep­res­ents a flexible al­tern­at­ive to direct callback functions. This enables the linking of objects or modules, for example, without these ne­ces­sar­ily having to be aware of one another.

Note

Qt is the ori­gin­at­or of the signal slot concept and has come to exemplify it over the years. However, since then, many other program libraries and frame­works such as Flow have come to rely upon the con­nec­tion model.

For a signal, this has spe­cific­ally to do with a message that sends an object as soon as a certain event occurs. Again, a slot is a regular function that can be linked to a signal, to then sub­sequently always be carried out if it receives the signal. It is possible to link a signal with several slots so that many functions can be called up as a result of a single event. The pro­gram­ming concept also allows the linking of several signals with a single slot. In this case, one and the same function is called up when different events occur.

The signals and slots help to bring an event-ori­ent­ated func­tion­al­ity to the user interface of the ap­plic­a­tion developed. However, in Qt, you do not have to create the signal slot re­la­tion­ships tediously and in­di­vidu­ally by hand – many of the classes of framework supplied provide access to diverse pre­defined signals and slots, but if required, you can also create your own object re­la­tion­ships.

What can the Qt’s own QML markup language do?

Since Version 4.7 Qt has been equipped with its own QML markup language, which has a JSON-like syntax and supports im­per­at­ive JavaS­cript ex­pres­sions. However, central to this is the de­clar­at­ive de­scrip­tion of the GUI elements that ensure a clear program code. QML therefore brings together de­clar­at­ive and im­per­at­ive ap­proaches into a single pro­gram­ming language, which ensures a great deal of leeway for the developer. If you have selected the Qt Quick model with the Qt Quick Compiler you have a suitable tool for compiling QML codes in native C++. Besides this, you can use the designer of the same name (Qt Quick Designer) in Qt Creator, to work with pre-prepared QML com­pon­ents.

QML shows its strengths in par­tic­u­lar in GUI de­vel­op­ment. Due to its simpler syntax, and support from JavaS­cript, it offers designers con­sid­er­ably better access than C++. For example, JSON-composed user in­ter­faces can be created simply by exporting from Photoshop, which con­sid­er­ably speeds up the de­vel­op­ment process. Even if it is possible in theory to write the entire program in QML, markup language tends to be rarely used when pro­gram­ming the ap­plic­a­tion logic.

Note

QML has made creating the UI via widgets su­per­flu­ous in many respects. Es­pe­cially when it involves an­im­a­tions and complete user-specific layouts and control com­pon­ents (mobile, touch­screen, etc.), the markup language demon­strates its strengths. However, if it involves tra­di­tion­al desktop operating elements such as menu bars, symbol bars, or drag-and-drop com­pon­ents, widgets offer better support, which is why their use in classic desktop en­vir­on­ments is still com­mon­place.

Which platforms does Qt run on?

Qt is supported by various 32-bit and 64-bit platforms. To use the framework, usually no more than GCC or another compiler is required, as well as a renderer such as Open GL, DirectX to use Qt Quick. The developer team lists the following of­fi­cially supported platforms for the current Qt version:

Platform Version Compiler
Windows 10, 8.1, 7, UWP (universal Windows platform) MSVC 2017, MSVC 2015, MinGW 5.3
Linux/X11 openSUSE 42.2, Red Hat En­ter­prise Linux 6.6 and 7.2, Ubuntu 16.04 GCC (from 4.8), ICC
Android from 4.1 GCC, MinGW 5.3
macOS etc. macOS (ab 10.11), iOS 10 and 11, tvOS 10 and 11, watchOS 3 and 4 Clang (Apple)
Embedded systems Embedded Linux, Embedded Linux (Boot2Qt), QNX 6.6.0 and 7.0, INTEGRITY 11.4.4 GCC

Where is Qt used?

Probably the best known software project in which the Qt framework is used is KDE Plasma (pre­vi­ously KDE Plasma Work­spaces), a range of desktop en­vir­on­ments or, since Version 5, an in­di­vidu­al flexible en­vir­on­ment from the open-source community KDE for various devices (desktop, Notebook, Netbook, tablet, or smart­phone). It provides layouts and control elements in its various desktop versions thanks to Qt, which is perfectly cus­tom­ised to the re­quire­ments of any devices.

Other prominent examples of software based on Qt show how varied the ap­plic­a­tion scenarios of the framework are:

Mul­ti­me­dia:

  • The image pro­cessing program, Adobe Photoshop Elements
  • The image man­age­ment program, Adobe Photoshop Album
  • The free mul­ti­me­dia player VLC media player
  • The Linux app of the music streaming service, Spotify

Com­mu­nic­a­tion:

  • The Linux edition of the com­mu­nic­a­tion tool, Skype
  • The instant messaging service, Telegram
  • The voice con­fer­en­cing software, TeamSpeak

File sharing:

  • The P2P client, Marabunta
  • The KDE download manager, KGet
  • Bit­Tor­rent client trans­mis­sion

3D graphics tools:

  • The 3D modelling software, Adobe Muse CC
  • The 3D vir­tu­al­isa­tion software, Autodesk Maya
  • The CAD software, AutoQ3D

Games:

  • Monkey Island
  • Dust Racing 2D

Others:

  • The layout program, Scribus
  • The math­em­at­ics software, Math­em­at­ica
  • The notation and com­pos­i­tion software, Sibelius

Summary: a flexible framework for varied, cross-platform projects

Qt is a framework found­a­tion that has con­tinu­ously adapted to the re­quire­ment of modern GUIs. It's easy to un­der­stand why the tool col­lec­tion written in C++ is still one of the most popular solutions for the platform-related de­vel­op­ment of graphic user in­ter­faces more than two decades after its release. This is ensured in par­tic­u­lar by tools such as Qt Creator or the markup language QML im­ple­men­ted in newer versions, which not only optimise the work process in general, but also co­oper­a­tion between designers and pro­gram­mers.

Go to Main Menu