The QDeclarativeError class encapsulates a QML error. More...
#include <QDeclarativeError>
This class was introduced in Qt 4.7.
QDeclarativeError () | |
QDeclarativeError ( const QDeclarativeError & other ) | |
int | column () const |
QString | description () const |
bool | isValid () const |
int | line () const |
void | setColumn ( int column ) |
void | setDescription ( const QString & description ) |
void | setLine ( int line ) |
void | setUrl ( const QUrl & url ) |
QString | toString () const |
QUrl | url () const |
QDeclarativeError & | operator= ( const QDeclarativeError & other ) |
QDebug | operator<< ( QDebug debug, const QDeclarativeError & error ) |
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:
file:///home/user/test.qml:7:8: Invalid property assignment: double expected
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.
file:///home/user/test.qml:7:8: Invalid property assignment: double expected y: "hello" ^
See also QDeclarativeView::errors() and QDeclarativeComponent::errors().
Creates an empty error object.
Creates a copy of other.
Returns the error column number.
See also setColumn().
Returns the error description.
See also setDescription().
Returns true if this error is valid, otherwise false.
Returns the error line number.
See also setLine().
Sets the error column number.
See also column().
Sets the error description.
See also description().
Sets the error line number.
See also line().
Sets the url for the file that caused this error.
See also url().
Returns the error as a human readable string.
Returns the url for the file that caused this error.
See also setUrl().
Assigns other to this error object.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.