CMake Cross-Compilation Based on Yocto SDK

We have succeeded in building embedded Linux with Yocto for a quad-core NXP i.MX6 (ARM Cortex-A9). Next, we want to cross-compile our own Qt application. As we use CMake for building our Qt application, we must create a CMake toolchain file. I am going to give a line-line by line explanation of the CMake toolchain file. I used Yocto Morty and CMake v3.5.1 (as it comes with Ubuntu 16.04 LTS).
Continue reading

Qt vs. Web (Part 1): Three Cautionary Stories About Web

Let XXX be a manufacturer of printers, TVs, set-top boxes (STBs) or home appliances. XXX must decide whether to use Qt or Web for the HMI of their devices. I’ll start my series “Qt vs. Web” with three cautionary stories about using Web technologies. Facebook moved from Web to native. Netflix built its own rendering engine and JavaScript HMI library to continue with Web technologies. Although LG’s smart TVs run on WebOS, the built-in and brand-critical TV UI uses QML and Qt. Third-party apps use standard Web technologies.
Continue reading

30% Faster Startup Thanks to QtQuick Compiler

It is not easy to find hard data about how much the QtQuick compiler can speed up the startup of real-life application. As I had some time on my hands this weekend, I measured the startup times of the HMI of a maize harvester running on a quad-core NXP/Freescale i.MX6 (Nit6Q_W_BCOM). Using the QtQuick compiler from Qt 5.7 brings the startup time from 2.72s down to 1.91s – a speedup of 30%!
Continue reading

Boot2Qt Open-Sourced as Part of Yocto

Tuukka Turunen from The Qt Company shared some fantastic news in his post Aligning with the Yocto Project.

We have created a separate Boot to Qt meta layer, meta-boot2qt, which takes care of building the images and toolchains for the reference devices. The meta-boot2qt layer integrates all the required BSP meta layers, so there is no manual configurations necessary when starting Yocto build for one of the Qt reference devices. The layer was previously available only for our commercial customers, but with Qt 5.7 we have open sourced it as well.

The Boot2Qt meta layer comes with support for all three versions of the Raspberry Pi, many i.MX6 boards (Nitrogen6x, SABRE, Colibri, etc.), the NVIDIA Drive CX and for the Intel NUC. This should make the live of embedded Qt developers a lot easier. Thank you very much, Trolls!

Finding Projects as a Freelance Software Developer

Three years ago aged 45, I started as a freelance software developer in Southern Germany. It were three pretty amazing years. I had paid work for 522.5 days of 750 working days, which amounts to nearly 70% of total working days. My hourly rate was roughly 94 Euros with 8 hours per day. Additionally, I passed on 285 days of work to other developers at a rate of 61 Euros. Despite this success, finding projects still feels a bit like black magic. Sometimes I could have got three projects at the same time. Sometimes I struggled for several months to find the next project. I want to share my experience in finding projects: what worked for me and what didn’t.
Continue reading

Best Friends: C++11 Move Semantics and Pimpl

Move semantics is faster than copy semantics, when the compiler can replace expensive copy operations by cheaper move operations, that is, when it can replace a deep copy of a big object by a shallow copy of the pointer to the big object. Hence, classes using the pimpl idiom in combination with move semantics should see a considerable speed-up. As Qt applies the pimpl idiom consistently to every non-trivial Qt class, we should see a speed-up by simply using Qt classes instead of their STL counterparts. I’ll compare the performance of classes that use move semantics with Qt and STL classes with and without applying the pimpl idiom.
Continue reading

Performance Gains Through C++11 Move Semantics

We explore when and how our code benefits most from equipping classes with move constructors and assignment operators. We analyse in detail, which constructors and assignment operators (move or copy) are called for C++98 and C++11 when we insert or emplace objects into containers, when we initialise containers and when we shuffle and sort containers. Finally, we run benchmarks for these operations and discuss the actual speed-up, which ranges from 1% to 70%.
Continue reading

Simplifying Loops with C++11 in Qt Ways

Recently, I looked through the code base of a medium-sized project to see how I could simplify handwritten for-loops by using C++11’s new range-based for and STL algorithms with lambda expressions. The results in short: Range-based for makes loops simpler, easier to understand and often faster. STL algorithms are often a bit harder to read and write than range-based for loops, because lambda expressions are pretty clumsy, algorithm naming is inconsistent, and algorithm interfaces are inconvenient. But, they are still better than handwritten for-loops.
Continue reading