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.
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.
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
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
Update: Since Qt 5.12, the QtQuick compiler has been available under LGPLv3. Even if you don't have a commercial Qt license, you will be able to enjoy a significantly faster startup of embedded QML applications. It is
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.
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
The HMIs of in-vehicle infotainment systems, TVs, phones and many other systems must adapt to different screen resolutions and formats. This adaptation should happen with as little duplicate effort as possible. The simplest way of doing this for QML HMIs
I wanted to replace many occurrences of g_theme.themeDisplay(100, 80, 65) by g_theme.thSz([100, 80, 65]) in many QML files. The values of the three integer arguments varied from occurrence to occurrence. What I hoped for
Never cast a negative float to an unsigned int. The result of the cast differs depending on whether the cast is executed on a device with Intel or ARM architecture. The C++ Standard decrees that the result of such a
How can we pass an instance of a QObject subclass from a Qt/C++ list model to a QML list view? How can we expose a property from a Qt/C++ class to QML, where the type of the property
How often is a an object copied, if it is emitted by a signal as a const reference and received by a slot as a const reference? How does the behaviour differ for direct and queued signal-slot connections? What changes