QDeclarativeError Class | Qt 4.8 (original) (raw)

The QDeclarativeError class encapsulates a QML error. More...

Header: #include
Since: Qt 4.7

Public Functions

QDebug operator<<(QDebug debug, const QDeclarativeError & error)

Detailed Description

The QDeclarativeError class encapsulates a QML error.

QDeclarativeError 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() 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.

See also QDeclarativeView::errors() and QDeclarativeComponent::errors().

Member Function Documentation

QDeclarativeError::QDeclarativeError()

Creates an empty error object.

QDeclarativeError::QDeclarativeError(const QDeclarativeError & other)

Creates a copy of other.

int QDeclarativeError::column() const

Returns the error column number.

See also setColumn().

QString QDeclarativeError::description() const

Returns the error description.

See also setDescription().

bool QDeclarativeError::isValid() const

Returns true if this error is valid, otherwise false.

int QDeclarativeError::line() const

Returns the error line number.

See also setLine().

void QDeclarativeError::setColumn(int column)

Sets the error column number.

See also column().

void QDeclarativeError::setDescription(const QString & description)

Sets the error description.

See also description().

void QDeclarativeError::setLine(int line)

Sets the error line number.

See also line().

void QDeclarativeError::setUrl(const QUrl & url)

Sets the url for the file that caused this error.

See also url().

QString QDeclarativeError::toString() const

Returns the error as a human readable string.

QUrl QDeclarativeError::url() const

Returns the url for the file that caused this error.

See also setUrl().

QDeclarativeError & QDeclarativeError::operator=(const QDeclarativeError & other)

Assigns other to this error object.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.