QQmlInfo Proxy Page

Functions

QQmlInfo qmlWarning(const QObject *object)

Function Documentation

QQmlInfo qmlWarning(const QObject *object)

Prints warning messages that include the file and line number for the specified QML object.

When QML types produce logging messages, it improves traceability if they include the QML file and line number on which the particular instance was instantiated.

To include the file and line number, an object must be passed. If the file and line number is not available for that instance (either it was not instantiated by the QML engine or location information is disabled), "unknown location" will be used instead.

For example,

 qmlInfo(object) << tr("property cannot be set to 0");

prints

 QML MyCustomType (unknown location): property cannot be set to 0

See also qmlDebug and qmlInfo.