Book Image

QT5 Blueprints

By : Symeon Huang
Book Image

QT5 Blueprints

By: Symeon Huang

Overview of this book

Table of Contents (17 chapters)
Qt 5 Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 the stack trace.

console.exception()

This function prints an error message together with the stack trace of the JavaScript execution at the point it is called.

console.trace()

This function prints the stack trace of the JavaScript execution...