The screenshot above shows the home screen of a sugar beet harvester. The home screen receives roughly 50 CAN messages per second and displays the contents of the CAN messages numerically or graphically.
Every number on the home screen is
The mathematician Leopold Kronecker is believed to have said:
God made the integers, all else is the work of man.
And Kronecker didn't even know the floating-point numbers "made" for computers. Comparing two numbers of type
Today, I looked at the data-driven unit tests I had written nearly four weeks ago. It took me a couple of minutes to understand the tests again. Understanding my own tests should have been much easier.
Data-driven unit tests in
When you write unit tests, you will have to compare the actual value and the expected value. A simplified example with QStrings would look like this.
void MyTest::testQCompare() {
auto actualStr = QString{"abba"};
auto expectedStr = QString{"juhu&
When you define your own C++ types for a Qt application, you want to print their values with qDebug(), qWarning() or qCritical() eventually.
auto frame1 = QCanBusFrame{0x18ef0201U, QByteArray::fromHex("018A010000000000")};
qDebug() << "frame1 =" <<
In the first post of the Speaking CAN series, we learned how the terminal sends a read-parameter request to the ECU and how the ECU sends a response with the value of the parameter back to the terminal. This works
The function CustomerDatabase::importCustomers reads 500 customers from the list c_customers, creates an SQL query cmd for each customer and inserts each customer into the Customers table of the SQL database db.
void CustomerDatabase::importCustomers() { auto db = QSqlDatabase::database(
In the beginning, the application shows the Main Screen. When the user clicks on the Open button, the application will show a second screen. The second screen creates a C++ model when opened and destroys this model when closed.
As
When the driver turns off the ignition in a vehicle, display computers like terminals in harvesters or infotainment systems in cars should be notified. The display computers should save important data and shut down orderly.
When the display computer runs
Correction: In the original post, I stated that ownership is transferred from C++ to QML by READ functions of Q_PROPERTYs. This is wrong. Ownership is only transferred by Q_INVOKABLE functions and slots, which return a QObject pointer. I
My program received messages from a network as an array of bytes. The sender of the messages encoded integers in Big Endian format. So, the hex number 0x1540 arrived in the sequence [0x15, 0x40]. I wrote the following function, which
My favourite new feature in Qt 5.10 is the inconspicuous function QmlEngine::retranslate(). Finally, seven years after QML's birth, there is a Qt way to change the language of your application at runtime. There is no need