QQmlError Class
The QQmlError class describes an error in a QML document. More…
| Header | #include <QQmlError> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Qml) |
| Module | Nt Qml C++ Classes |
List of all members, including inherited members
Public Functions
| QQmlError() | |
| bool | isValid() const |
| QUrl | url() const |
| void | setUrl(const QUrl &url) |
| QString | description() const |
| void | setDescription(const QString &description) |
| int | line() const |
| void | setLine(int line) |
| int | column() const |
| void | setColumn(int column) |
| QtMsgType | messageType() const |
| void | setMessageType(QtMsgType messageType) |
| QString | toString() const |
Detailed Description
for (const QQmlError &e : component.errors())
qWarning() << e.url() << e.line() << e.description();
See also QQmlComponent::errors() and QQmlEngine::warnings().
Differences from Qt
There is no object() or swap().
Member Function Documentation
QQmlError::QQmlError()
Constructs an empty error.
int QQmlError::column() const
Returns the column, from 1, or -1 if it is not known.
QString QQmlError::description() const
Returns the description.
bool QQmlError::isValid() const
Returns true if the error has a URL and a description; otherwise returns false.
int QQmlError::line() const
Returns the line, from 1, or -1 if it is not known.
QtMsgType QQmlError::messageType() const
Returns the type of the message, QtWarningMsg by default.
void QQmlError::setColumn(int column)
Sets the column to column.
void QQmlError::setDescription(const QString &description)
Sets the description to description.
void QQmlError::setLine(int line)
Sets the line to line.
void QQmlError::setMessageType(QtMsgType messageType)
Sets the type of the message to messageType.
void QQmlError::setUrl(const QUrl &url)
Sets the URL of the document to url.
QString QQmlError::toString() const
Returns the error as "url:line:column: description".
QUrl QQmlError::url() const
Returns the URL of the document.