Latest posts — page 14

Pretty-Printing Output for QCOMPARE

We have created a custom class, say Person, and use it in a unit test. void TestPerson::testEquality() { Person p1("Alice", 42); Person p2("Bob", 37); QCOMPARE(p1, p2); } The unit test fails with this message.

Passing Enum Properties between C++ and QML

We have defined a Qt property warningLevel in the C++ class MainModel: Q_PROPERTY(WarningLevel::Enum warningLevel READ warningLevel WRITE setWarningLevel NOTIFY warningLevelChanged) We want to use this property in QML. For example, we want to colour a rectangle according

Offshoring Becomes Too Expensive

After offshoring and near-shoring, there is a new outsourcing trend: domestic outsourcing. For example, a company in California outsources work to a company in Indiana or Wisconsin. A New York Times article sheds some light on the reasons for domestic

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

Is a C++ Float Variable Ever Equal to 0.0f?

The answer to the question in the title is a resounding "maybe". The writer of a piece of code wanted to avoid a division-by-zero error by checking whether the divisor of type float is not equal to 0.

Responsive QML HMIs with File Selectors

In my previous post, I have shown how to use scaling to adapt QML HMIs to different screen sizes and formats. We reach the limits of scaling if we must change the structure of the HMI or if the HMI