Debugging QML

The most common practice to debug QML is the use of the API console. JavaScript developers should be familiar with this because of the console support in QML. The relationships between the console functions and the Qt/C++ QDebug functions are given as follows:

QML

Qt/C++

console.log()

qDebug()

console.debug()

qDebug()

console.info()

qDebug()

console.warn()

qWarning()

console.error()

qCritical()

With the preceding supports present, QML is just like JavaScript programming. At the same time, the following functions are also introduced in QML:

Functions

Description

console.assert()

This function tests whether the expression is true. If not, it will write an optional message to the console and print ...

Get Qt 5 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.