![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QQmlError class encapsulates a QML error. More...
#include <qqmlerror.h>
Public Member Functions | |
| QQmlError () | |
| Creates an empty error object. | |
| QQmlError (const QQmlError &) | |
| Creates a copy of other. | |
| QQmlError (QQmlError &&other) noexcept | |
| QQmlError & | operator= (const QQmlError &) |
| Assigns other to this error object. | |
| ~QQmlError () | |
| void | swap (QQmlError &other) |
| bool | isValid () const |
| Returns true if this error is valid, otherwise false. | |
| QUrl | url () const |
| Returns the url for the file that caused this error. | |
| void | setUrl (const QUrl &) |
| Sets the url for the file that caused this error. | |
| QString | description () const |
| Returns the error description. | |
| void | setDescription (const QString &) |
| Sets the error description. | |
| int | line () const |
| Returns the error line number. | |
| void | setLine (int) |
| Sets the error line number. | |
| int | column () const |
| Returns the error column number. | |
| void | setColumn (int) |
| Sets the error column number. | |
| QObject * | object () const |
| Returns the nearest object where this error occurred. | |
| void | setObject (QObject *) |
| Sets the nearest object where this error occurred. | |
| QtMsgType | messageType () const |
| void | setMessageType (QtMsgType messageType) |
| QString | toString () const |
| Returns the error as a human readable string. | |
Friends | |
| bool Q_QML_EXPORT | operator== (const QQmlError &a, const QQmlError &b) |
Related Symbols | |
(Note that these are not member symbols.) | |
| QDebug | operator<< (QDebug debug, const QQmlError &error) |
| Outputs a human readable version of error to debug. | |
The QQmlError class encapsulates a QML error.
QQmlError includes a textual description of the error, as well as location information (the file, line, and column). The toString() method creates a single-line, human-readable string containing all of this information, for example:
You can use qDebug(), qInfo(), or qWarning() to output errors to the console. This method will attempt to open the file indicated by the error and include additional contextual information.
Definition at line 18 of file qqmlerror.h.
| QQmlError::QQmlError | ( | ) |
Creates an empty error object.
Definition at line 64 of file qqmlerror.cpp.
| QQmlError::QQmlError | ( | const QQmlError & | other | ) |
Creates a copy of other.
Definition at line 72 of file qqmlerror.cpp.
|
inlinenoexcept |
Definition at line 23 of file qqmlerror.h.
| QQmlError::~QQmlError | ( | ) |
Definition at line 102 of file qqmlerror.cpp.
| int QQmlError::column | ( | ) | const |
Returns the error column number.
Definition at line 178 of file qqmlerror.cpp.
| QString QQmlError::description | ( | ) | const |
Returns the error description.
Definition at line 138 of file qqmlerror.cpp.
| bool QQmlError::isValid | ( | ) | const |
Returns true if this error is valid, otherwise false.
Definition at line 110 of file qqmlerror.cpp.
| int QQmlError::line | ( | ) | const |
Returns the error line number.
Definition at line 158 of file qqmlerror.cpp.
| QtMsgType QQmlError::messageType | ( | ) | const |
| QObject * QQmlError::object | ( | ) | const |
Returns the nearest object where this error occurred.
Exceptions in bound property expressions set this to the object to which the property belongs. It will be 0 for all other exceptions.
Definition at line 201 of file qqmlerror.cpp.
Assigns other to this error object.
Definition at line 81 of file qqmlerror.cpp.
| void QQmlError::setColumn | ( | int | column | ) |
Sets the error column number.
Definition at line 188 of file qqmlerror.cpp.
Sets the error description.
Definition at line 148 of file qqmlerror.cpp.
| void QQmlError::setLine | ( | int | line | ) |
Sets the error line number.
Definition at line 168 of file qqmlerror.cpp.
Sets the messageType for this message. The message type determines which QDebug handlers are responsible for receiving the message.
Definition at line 236 of file qqmlerror.cpp.
Sets the nearest object where this error occurred.
Definition at line 211 of file qqmlerror.cpp.
Sets the url for the file that caused this error.
Definition at line 128 of file qqmlerror.cpp.
Definition at line 31 of file qqmlerror.h.
| QString QQmlError::toString | ( | ) | const |
Returns the error as a human readable string.
Definition at line 246 of file qqmlerror.cpp.
| QUrl QQmlError::url | ( | ) | const |
Returns the url for the file that caused this error.
Definition at line 118 of file qqmlerror.cpp.
Outputs a human readable version of error to debug.
Definition at line 283 of file qqmlerror.cpp.
Definition at line 271 of file qqmlerror.cpp.