Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlInfo Class Reference

\inmodule QtQml More...

#include <qqmlinfo.h>

+ Inheritance diagram for QQmlInfo:
+ Collaboration diagram for QQmlInfo:

Public Member Functions

 QQmlInfo (const QQmlInfo &)
 
 ~QQmlInfo ()
 
QQmlInfooperator<< (QChar t)
 
QQmlInfooperator<< (bool t)
 
QQmlInfooperator<< (char t)
 
QQmlInfooperator<< (signed short t)
 
QQmlInfooperator<< (unsigned short t)
 
QQmlInfooperator<< (signed int t)
 
QQmlInfooperator<< (unsigned int t)
 
QQmlInfooperator<< (signed long t)
 
QQmlInfooperator<< (unsigned long t)
 
QQmlInfooperator<< (qint64 t)
 
QQmlInfooperator<< (quint64 t)
 
QQmlInfooperator<< (float t)
 
QQmlInfooperator<< (double t)
 
QQmlInfooperator<< (const char *t)
 
QQmlInfooperator<< (const QString &t)
 
QQmlInfooperator<< (QStringView t)
 
QQmlInfooperator<< (const QLatin1String &t)
 
QQmlInfooperator<< (const QByteArray &t)
 
QQmlInfooperator<< (const void *t)
 
QQmlInfooperator<< (QTextStreamFunction f)
 
QQmlInfooperator<< (QTextStreamManipulator m)
 
QQmlInfooperator<< (const QUrl &t)
 

Friends

Q_QML_EXPORT QQmlInfo qmlDebug (const QObject *me)
 
Q_QML_EXPORT QQmlInfo qmlDebug (const QObject *me, const QQmlError &error)
 
Q_QML_EXPORT QQmlInfo qmlDebug (const QObject *me, const QList< QQmlError > &errors)
 
Q_QML_EXPORT QQmlInfo qmlInfo (const QObject *me)
 Prints informational messages that include the file and line number for the specified QML object.
 
Q_QML_EXPORT QQmlInfo qmlInfo (const QObject *me, const QQmlError &error)
 
Q_QML_EXPORT QQmlInfo qmlInfo (const QObject *me, const QList< QQmlError > &errors)
 
Q_QML_EXPORT QQmlInfo qmlWarning (const QObject *me)
 
Q_QML_EXPORT QQmlInfo qmlWarning (const QObject *me, const QQmlError &error)
 
Q_QML_EXPORT QQmlInfo qmlWarning (const QObject *me, const QList< QQmlError > &errors)
 

Related Symbols

(Note that these are not member symbols.)

QQmlInfo qmlInfo (const QObject *object)
 Prints informational messages that include the file and line number for the specified QML object.
 
QQmlInfo qmlWarning (const QObject *object)
 

Detailed Description

\inmodule QtQml

The QQmlInfo class allows logging of QML-related messages.

QQmlInfo is an opaque handle for QML-related diagnostic messages. You can use the {<<} operator to add content to the message. When the QQmlInfo object is destroyed, it prints the resulting message along with information on the context.

See also
qmlDebug, qmlInfo, qmlWarning

Definition at line 29 of file qqmlinfo.h.

Constructor & Destructor Documentation

◆ QQmlInfo()

QQmlInfo::QQmlInfo ( const QQmlInfo & other)

Definition at line 167 of file qqmlinfo.cpp.

References QQmlInfoPrivate::ref.

◆ ~QQmlInfo()

QQmlInfo::~QQmlInfo ( )

Definition at line 173 of file qqmlinfo.cpp.

References QQmlInfoPrivate::buffer, engine, error, QQmlInfoPrivate::errors, QQmlData::get(), QString::isEmpty(), QQmlInfoPrivate::msgType, QQmlInfoPrivate::object, QString::prepend(), QQmlMetaType::prettyTypeName(), qmlEngine(), QQmlInfoPrivate::ref, and QQmlEnginePrivate::warning().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator<<() [1/22]

QQmlInfo & QQmlInfo::operator<< ( bool t)
inline

Definition at line 36 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [2/22]

QQmlInfo & QQmlInfo::operator<< ( char t)
inline

Definition at line 37 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [3/22]

QQmlInfo & QQmlInfo::operator<< ( const char * t)
inline

Definition at line 48 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [4/22]

QQmlInfo & QQmlInfo::operator<< ( const QByteArray & t)
inline

Definition at line 52 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [5/22]

QQmlInfo & QQmlInfo::operator<< ( const QLatin1String & t)
inline

Definition at line 51 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [6/22]

QQmlInfo & QQmlInfo::operator<< ( const QString & t)
inline

Definition at line 49 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [7/22]

QQmlInfo & QQmlInfo::operator<< ( const QUrl & t)
inline

Definition at line 57 of file qqmlinfo.h.

◆ operator<<() [8/22]

QQmlInfo & QQmlInfo::operator<< ( const void * t)
inline

Definition at line 53 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [9/22]

QQmlInfo & QQmlInfo::operator<< ( double t)
inline

Definition at line 47 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [10/22]

QQmlInfo & QQmlInfo::operator<< ( float t)
inline

Definition at line 46 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [11/22]

QQmlInfo & QQmlInfo::operator<< ( QChar t)
inline

Definition at line 35 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [12/22]

QQmlInfo & QQmlInfo::operator<< ( qint64 t)
inline

Definition at line 44 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [13/22]

QQmlInfo & QQmlInfo::operator<< ( QStringView t)
inline

Definition at line 50 of file qqmlinfo.h.

References operator<<().

Referenced by operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<() [14/22]

QQmlInfo & QQmlInfo::operator<< ( QTextStreamFunction f)
inline

Definition at line 54 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [15/22]

QQmlInfo & QQmlInfo::operator<< ( QTextStreamManipulator m)
inline

Definition at line 55 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [16/22]

QQmlInfo & QQmlInfo::operator<< ( quint64 t)
inline

Definition at line 45 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [17/22]

QQmlInfo & QQmlInfo::operator<< ( signed int t)
inline

Definition at line 40 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [18/22]

QQmlInfo & QQmlInfo::operator<< ( signed long t)
inline

Definition at line 42 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [19/22]

QQmlInfo & QQmlInfo::operator<< ( signed short t)
inline

Definition at line 38 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [20/22]

QQmlInfo & QQmlInfo::operator<< ( unsigned int t)
inline

Definition at line 41 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [21/22]

QQmlInfo & QQmlInfo::operator<< ( unsigned long t)
inline

Definition at line 43 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

◆ operator<<() [22/22]

QQmlInfo & QQmlInfo::operator<< ( unsigned short t)
inline

Definition at line 39 of file qqmlinfo.h.

References QDebug::operator<<().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ qmlDebug [1/3]

Q_QML_EXPORT QQmlInfo qmlDebug ( const QObject * me)
friend

◆ qmlDebug [2/3]

Q_QML_EXPORT QQmlInfo qmlDebug ( const QObject * me,
const QList< QQmlError > & errors )
friend

◆ qmlDebug [3/3]

Q_QML_EXPORT QQmlInfo qmlDebug ( const QObject * me,
const QQmlError & error )
friend

◆ qmlInfo [1/4]

QQmlInfo qmlInfo ( const QObject * object)
friend

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

\fn QQmlInfo qmlDebug(const QObject *object)
\relates QQmlInfo
\since 5.9

Prints debug messages that include the file and line number for the
specified QML \a object.

! [qqmlinfo-desc] 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. ! [qqmlinfo-desc]

For example,

\code
qmlDebug(object) << "Internal state: 42";
\endcode

prints

\badcode
QML MyCustomType (unknown location): Internal state: 42
\endcode

\sa qmlInfo, qmlWarning

qqmlinfo-desc

For example,

qmlInfo(object) << tr("component property is a write-once property");
friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me)
Prints informational messages that include the file and line number for the specified QML object.
#define tr(X)

prints

\badcode QML MyCustomType (unknown location): component property is a write-once property

Note
In versions prior to Qt 5.9, qmlInfo reported messages using a warning QtMsgType. For Qt 5.9 and above, qmlInfo uses an info QtMsgType. To send warnings, use qmlWarning.
See also
qmlDebug, qmlWarning

◆ qmlInfo [2/4]

Q_QML_EXPORT QQmlInfo qmlInfo ( const QObject * me,
const QList< QQmlError > & errors )
friend

◆ qmlInfo [3/4]

Q_QML_EXPORT QQmlInfo qmlInfo ( const QObject * me,
const QQmlError & error )
friend

◆ qmlInfo() [4/4]

QQmlInfo qmlInfo ( const QObject * object)
related

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

\fn QQmlInfo qmlDebug(const QObject *object)
\relates QQmlInfo
\since 5.9

Prints debug messages that include the file and line number for the
specified QML \a object.

! [qqmlinfo-desc] 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. ! [qqmlinfo-desc]

For example,

\code
qmlDebug(object) << "Internal state: 42";
\endcode

prints

\badcode
QML MyCustomType (unknown location): Internal state: 42
\endcode

\sa qmlInfo, qmlWarning

qqmlinfo-desc

For example,

qmlInfo(object) << tr("component property is a write-once property");

prints

\badcode QML MyCustomType (unknown location): component property is a write-once property

Note
In versions prior to Qt 5.9, qmlInfo reported messages using a warning QtMsgType. For Qt 5.9 and above, qmlInfo uses an info QtMsgType. To send warnings, use qmlWarning.
See also
qmlDebug, qmlWarning

◆ qmlWarning [1/4]

QQmlInfo qmlWarning ( const QObject * object)
friend
Since
5.9

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

qqmlinfo-desc

For example,

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

prints

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

See also
qmlDebug, qmlInfo

◆ qmlWarning [2/4]

Q_QML_EXPORT QQmlInfo qmlWarning ( const QObject * me,
const QList< QQmlError > & errors )
friend

◆ qmlWarning [3/4]

Q_QML_EXPORT QQmlInfo qmlWarning ( const QObject * me,
const QQmlError & error )
friend

◆ qmlWarning() [4/4]

QQmlInfo qmlWarning ( const QObject * object)
related
Since
5.9

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

qqmlinfo-desc

For example,

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

prints

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

See also
qmlDebug, qmlInfo

The documentation for this class was generated from the following files: