![]() |
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 17 of file qqmlerror.h.
QQmlError::QQmlError | ( | ) |
Creates an empty error object.
Definition at line 63 of file qqmlerror.cpp.
QQmlError::QQmlError | ( | const QQmlError & | other | ) |
Creates a copy of other.
Definition at line 71 of file qqmlerror.cpp.
|
inlinenoexcept |
Definition at line 22 of file qqmlerror.h.
QQmlError::~QQmlError | ( | ) |
Definition at line 101 of file qqmlerror.cpp.
int QQmlError::column | ( | ) | const |
Returns the error column number.
Definition at line 177 of file qqmlerror.cpp.
QString QQmlError::description | ( | ) | const |
Returns the error description.
Definition at line 137 of file qqmlerror.cpp.
bool QQmlError::isValid | ( | ) | const |
Returns true if this error is valid, otherwise false.
Definition at line 109 of file qqmlerror.cpp.
int QQmlError::line | ( | ) | const |
Returns the error line number.
Definition at line 157 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 200 of file qqmlerror.cpp.
Assigns other to this error object.
Definition at line 80 of file qqmlerror.cpp.
void QQmlError::setColumn | ( | int | column | ) |
Sets the error column number.
Definition at line 187 of file qqmlerror.cpp.
Sets the error description.
Definition at line 147 of file qqmlerror.cpp.
void QQmlError::setLine | ( | int | line | ) |
Sets the error line number.
Definition at line 167 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 235 of file qqmlerror.cpp.
Sets the nearest object where this error occurred.
Definition at line 210 of file qqmlerror.cpp.
Sets the url for the file that caused this error.
Definition at line 127 of file qqmlerror.cpp.
Definition at line 30 of file qqmlerror.h.
QString QQmlError::toString | ( | ) | const |
Returns the error as a human readable string.
Definition at line 245 of file qqmlerror.cpp.
QUrl QQmlError::url | ( | ) | const |
Returns the url for the file that caused this error.
Definition at line 117 of file qqmlerror.cpp.
Outputs a human readable version of error to debug.
Definition at line 282 of file qqmlerror.cpp.
Definition at line 270 of file qqmlerror.cpp.