The Qt framework is the number one choice for embedded systems development. In this article, we talk about the benefits of Qt and also review other cross-platform toolkits and their capabilities.

Qt Tools for Cross-Platform Application Development

Qt Tools for Cross-Platform Application Development

Cross-platform frameworks have gained popularity among developers by saving time and money on creating applications for different environments.

Qt is one of the most popular GUI frameworks. Based on C++, Qt is widely used for creating applications to be run on different platforms:

  • desktop;
  • mobile;

C++ is an object-oriented programming language (OOP). Therefore, C++ application development is safe and efficient.

An application written in C++ can be compiled on many platforms without modifying its source code (the “Write Once, Compile Anywhere” or “WOCA” principle).

You can use Qt under commercial and open-source licenses. Qt is free for non-commercial use. You have to buy a commercial license if you are going to distribute your application.

Qt offers you various useful tools to create cross-platform applications for embedded devices. Here are some examples:

  • Qt Creator is a fast and responsive IDE that has built-in templates and an extensive plugin-based architecture.
  • Qt Design Studio is a cut-down variant of Qt Creator. It has 2D/3D tools that help to create user interfaces, user experiences, and human-machine interfaces.
  • The Qt Designer allows you to create graphical user interfaces using several tools. A characteristic feature of Qt Designer is the support for the visual editing of signals and slots. Qt Designer can be run as a standalone application.
  • Qmake is a module that helps facilitate the building process across various platforms. You are able to choose this utility for software written with another framework.
  • QML is Qt’s declarative language for designing UI applications at great speed.
  • Qt provides developers with Automotive Suite software modules and tools for building in-vehicle infotainment (IVI) systems. The Automotive Suite offers the Qt Application Manager with a high-level API to make UI system development easier. The Qt GENIVI Extras module is in charge of the compatibility of the product with the GENIVI automotive platform structure. Neptune 3 UI has to develop a user interface for Qt in automotive infotainment (IVI) systems.
  • The Qt Interface Framework module is in charge of providing tools for middleware components’ (APIs, backends, services) development.
  • The Qt Safe Renderer module has a user interface rendering element to separate important interpretations from the rest of the system. In the event of failures or emergencies, thanks to this module, the most important elements of the system will be displayed.
The Qt Creator screenshot.
The Qt Creator screenshot.

Sustainable Benefits from Qt and C++ for Embedded Systems

C++ is among the most widely used languages for embedded devices. Here are some C++ strengths:

  • C++ is between higher-level software and hardware. Developers have access to hardware control while retaining the benefits of a high-level language.
  • C++ is highly stable. C++ programs can function for many years, which is very suitable for hardware.
  • C++ is a processor-independent language.
  • The C++ data structure is based on algorithms, so it fits well with the tasks that arise in the course of embedded systems’ development.
  • The Qt framework adds to the benefits of C++ with its flexibility, support for multiple platforms, and a variety of tools and modules.

Also, there are some difficulties in working with C++:

  • Strictness, verbosity, and the difficult learning process of C++ are challenges for new developers.
  • The second problem is a continuation of the first one: maintaining a codebase can be quite hard.
  • Web technologies require more flexibility than C++ has.

Qt can give developers all the tools they need to create software for embedded systems in consumer electronics, industrial automation, medical equipment, automotive, telecommunications, and security.

The advantages of using Qt for embedded system development are the following:

  • Qt provides a wide range of instruments for building cross-platform applications with a UI. It also works well for non-UI app development.
  • Qt has variable modules for GUI, networking, multimedia, 3D, and much more.
  • This framework has the widest cross-platform compatibility.
  • Qt allows developers to create highly efficient applications very quickly.
  • Qt runs on different processors and uses memory efficiently. It delivers vibrant graphics on multiple displays.
  • A lot of bindings for other languages are available. Designers can write software in a language that is convenient and familiar to them.
  • Qt has a large community and technical support team. There are plenty of case studies, documentation, and training materials.

Some shortcomings in the framework can be noted in terms of objectivity. All of them are insignificant and removable.

  • It is hard for inexperienced designers to use the complicated C++ language.
  • The speed of application layout is slower than that of native ones.
  • Cross-compilation may require further actions.

Qt Implementation in a Real Project

Qt enables designers to solve many issues easily and quickly and to create functional applications meeting customer expectations on time.

Let’s look at a project where the decision to use Qt saved the day.

The task was to create a portable gadget with sensors that could measure the distance between barriers. Programmers should create mobile software for interacting with gadgets. The radar module was supposed to transmit a point cloud over BLE. The Orange Pi computer had to transfer images from the CSI camera to the Android tablet. Qt was originally planned only for creating Android applications.

Significant issues necessitated the project’s adjustment. In the course of the project’s implementation, it turned out that the point cloud must be transmitted through a microcomputer via UART. The previously selected microcomputer could not work correctly with Bluetooth, and the CSI camera did not work on it.

As a consequence, developers have chosen to use the Raspberry Pi for the correct work of the CSI camera and Bluetooth. To change the project concept, designers had to make changes in the client part, which worked on the microcontroller. It was necessary to create a WiFi hotspot with a specific SSID and password on the Android tablet. The ATPS module, when detecting a WiFi network with the selected SSID, should automatically connect to it. The ATPS module also had to implement the GATT server, and the mobile application would transmit its IP address to the device via BLE. The video stream from the camera was transmitted via RTSP, but it was decided to transfer the transmission of data received from the sensor to a TCP connection. Control and information messages also went over TCP.

Initially, the client part was developed in Python, but performance problems arose. Qt developers solved the issue by building a multi-threaded embedded application with the ability to work with both BLE and TCP without a large data processing backlog. Qt also made it possible to use the Wiring Pi library for communication with an external buzzer and an I2C LED module.

Having applied the Qt framework to the client part of the project, the designers quickly created a complex application. The project was delivered on schedule.

Other Cross-Platform Toolkits

Plenty of solutions can do the same job as Qt. When choosing an appropriate variant, the developer takes into account his experience, the task, and other features of the project.

Below you can find a detailed review of popular cross-platform solutions.

.NET is a cross-platform Microsoft modular environment.

The main features of the solution are:

  • open-source;
  • compliant with Linux, Windows, and macOS;
  • C #, F #, and Visual Basic can be used to create applications;
  • Visual Studio IDE;
  • large community.

The .Net development platform is a combination of the .NET Framework, .NET Core, Xamarin, and Universal Windows Platform. Each of the realizations has libraries and tools to create different software.

Xamarin is a branch of the .Net platform and a popular tool for mobile application engineering. It supports the concept of “write once, run anywhere” (WORA).

Basic features of Xamarin:

  • fully open-source;
  • C#;
  • APIs and native user interfaces;
  • automatic updating of cross-platform applications.

Flutter is a Google UI framework. It sustains the WORA concept.

Key elements of Flutter:

  • A single codebase for Windows, Linux, Android, iOS, and other architectures;
  • Dart is the programming language used to create applications;
  • Two widget packages for Google and Apple’s design languages.

Java is one of the most sought-after programming languages nowadays. There are over 30 Java frameworks created for different purposes. Despite significant differences in goals, tasks, and execution, all toolkits have something in common:

  • They are lightweight;
  • assist with the WORA concept;
  • accelerate application development;
  • provide easy testing;

GTK+ is a cross-platform widget toolkit for creating GUI programs.

The main features of GTK are:

  • open-source;
  • It’s written in C, but there are numerous bindings available;
  • good support for powerful themes.

The Simple DirectMedia Layer (SDL) is a cross-platform software development library. It is mainly used for writing games and other multimedia software.

Key features of SDL:

  • open-source;
  • It is a market leader in language translation.
  • It’s written in C, C++, or Objective-C. There are some bindings available.
  • Support for multiple windows;
  • hardware-accelerated 2D graphics.

GUI frameworks in C++

GUI frameworks in C++

There are a lot of C++ multi-platform GUI toolkits similar to Qt. Here are the pros and cons of some of them.

wxWidgets is a software package and a tool library for GUI engineering.

Advantages of wxWidgets:

  • open-source and free;
  • There are bindings for many programming languages available.
  • well-developed;
  • fast;
  • It uses a native software development kit for each platform.
  • quickly adaptable.

wxWidgets has the following drawbacks:

  • It is difficult to install on Windows.

FLTK is a C++ GUI package for different platforms. It supports 3D graphics and has a handy UI builder for fast application development.

FLTK advantages:

  • free and open-source software, even for commercial use;
  • lightweight;
  • It is simple and easy for beginners.
  • online endorsement from developers and specialists;
  • It makes it simple for developers to create widgets.

Drawbacks:

  • makes use of non-native widgets;
  • It is too simple for comprehensive projects.

JUCE is one more cross-platform C++ framework. It is popular among developers of audio applications.

JUCE’s advantages:

  • various audio app creation functionalities;
  • lightweight;
  • several commercial licensing levels.

Drawbacks:

  • partly open-source.

One of the C++ toolkits is Ultimate ++. It provides rapid GUI application development and compact and easily readable code using templates.  All the libraries in Ultimate++ are designed to be used together.

Benefits from U++:

  • It is simple to use;
  • efficient C++ library;
  • documentation, tutorials, and a useful community;
  • the ability to create large С++ applications.

U++ has the following drawbacks:

  • closed-source;
  • merely C++.

Each C++ GUI toolkit serves a different purpose, and each has its own advantages. The undoubted benefit of Qt is the convenience of developing applications for embedded systems.

Conclusion

There are many useful toolkits for creating cross-platform applications for embedded systems. The developers choose one or another solution based on the goals, the size, and timing of the project, as well as their experience and preferences.

Qt is a commonly used C++ cross-platform framework for embedded devices. The advantages of this toolkit are its wide cross-platform capabilities, speed, and ease of creating applications. Almost every question can be answered by the huge community of Qt developers. Applications written in C++ have been working flawlessly for many years. This is why C and C++ are the most popular choices for embedded systems.

Integra Sources

https://www.integrasources.com/