Qt 4.8
|
The QDeclarativeError class encapsulates a QML error. More...
#include <qdeclarativeerror.h>
Public Functions | |
int | column () const |
Returns the error column number. More... | |
QString | description () const |
Returns the error description. More... | |
bool | isValid () const |
Returns true if this error is valid, otherwise false. More... | |
int | line () const |
Returns the error line number. More... | |
QDeclarativeError & | operator= (const QDeclarativeError &) |
Assigns other to this error object. More... | |
QDeclarativeError () | |
Creates an empty error object. More... | |
QDeclarativeError (const QDeclarativeError &) | |
Creates a copy of other. More... | |
void | setColumn (int) |
Sets the error column number. More... | |
void | setDescription (const QString &) |
Sets the error description. More... | |
void | setLine (int) |
Sets the error line number. More... | |
void | setUrl (const QUrl &) |
Sets the url for the file that caused this error. More... | |
QString | toString () const |
Returns the error as a human readable string. More... | |
QUrl | url () const |
Returns the url for the file that caused this error. More... | |
~QDeclarativeError () | |
Properties | |
QDeclarativeErrorPrivate * | d |
Related Functions | |
(Note that these are not member functions.) | |
QDebug | operator<< (QDebug debug, const QDeclarativeError &error) |
Outputs a human readable version of error to debug. More... | |
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.
Definition at line 56 of file qdeclarativeerror.h.
QDeclarativeError::QDeclarativeError | ( | ) |
QDeclarativeError::QDeclarativeError | ( | const QDeclarativeError & | other | ) |
QDeclarativeError::~QDeclarativeError | ( | ) |
Definition at line 131 of file qdeclarativeerror.cpp.
int QDeclarativeError::column | ( | ) | const |
Returns the error column number.
Definition at line 201 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeEnginePrivate::createQmlObject(), operator<<(), setColumn(), and toString().
QString QDeclarativeError::description | ( | ) | const |
Returns the error description.
Definition at line 165 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeCompiler::compile(), QDeclarativeEnginePrivate::createQmlObject(), QDeclarativeDirParser::errors(), QDeclarativeComponent::errorString(), QDeclarativeImportsPrivate::importExtension(), setDescription(), and toString().
bool QDeclarativeError::isValid | ( | ) | const |
Returns true if this error is valid, otherwise false.
Definition at line 139 of file qdeclarativeerror.cpp.
int QDeclarativeError::line | ( | ) | const |
Returns the error line number.
Definition at line 183 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeEnginePrivate::createQmlObject(), QDeclarativeComponent::errorString(), operator<<(), setLine(), and toString().
QDeclarativeError & QDeclarativeError::operator= | ( | const QDeclarativeError & | other | ) |
Assigns other to this error object.
Definition at line 113 of file qdeclarativeerror.cpp.
void QDeclarativeError::setColumn | ( | int | column | ) |
Sets the error column number.
Definition at line 210 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeTypeData::done(), QDeclarativeCustomParser::error(), QDeclarativeExpressionPrivate::exceptionToError(), QDeclarativeScriptParser::parse(), QDeclarativeDirParser::reportError(), QDeclarativeTypeData::resolveTypes(), throwException(), and QDeclarativeInfo::~QDeclarativeInfo().
void QDeclarativeError::setDescription | ( | const QString & | description | ) |
Sets the error description.
Definition at line 174 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeEnginePrivate::createCache(), QDeclarativeTypeData::done(), QDeclarativeCustomParser::error(), QDeclarativeDirParser::errors(), QDeclarativeExpressionPrivate::exceptionToError(), QDeclarativeDomDocument::load(), QDeclarativeDataLoader::load(), QDeclarativeComponent::loadUrl(), QDeclarativeDataBlob::networkError(), QDeclarativeDirParser::parse(), QDeclarativeScriptParser::parse(), QDeclarativeDirParser::reportError(), QDeclarativeTypeData::resolveTypes(), throwException(), and QDeclarativeInfo::~QDeclarativeInfo().
void QDeclarativeError::setLine | ( | int | line | ) |
Sets the error line number.
Definition at line 192 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeTypeData::done(), QDeclarativeCustomParser::error(), QDeclarativeExpressionPrivate::exceptionToError(), QDeclarativeScriptParser::parse(), QDeclarativeDirParser::reportError(), QDeclarativeTypeData::resolveTypes(), throwException(), and QDeclarativeInfo::~QDeclarativeInfo().
void QDeclarativeError::setUrl | ( | const QUrl & | url | ) |
Sets the url for the file that caused this error.
Definition at line 156 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeCompiler::buildObject(), QDeclarativeTypeData::done(), QDeclarativeExpressionPrivate::exceptionToError(), QDeclarativeDataLoader::load(), QDeclarativeDataBlob::networkError(), QDeclarativeScriptParser::parse(), QDeclarativeDirParser::reportError(), QDeclarativeWorkerScriptEnginePrivate::reportScriptException(), QDeclarativeTypeData::resolveTypes(), throwException(), and QDeclarativeInfo::~QDeclarativeInfo().
QString QDeclarativeError::toString | ( | ) | const |
Returns the error as a human readable string.
Definition at line 219 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeEnginePrivate::createQmlObject(), dumpwarning(), and operator<<().
QUrl QDeclarativeError::url | ( | ) | const |
Returns the url for the file that caused this error.
Definition at line 147 of file qdeclarativeerror.cpp.
Referenced by QDeclarativeEnginePrivate::createQmlObject(), QDeclarativeComponent::errorString(), operator<<(), setUrl(), and toString().
|
related |
Outputs a human readable version of error to debug.
Definition at line 247 of file qdeclarativeerror.cpp.
|
private |
Definition at line 77 of file qdeclarativeerror.h.
Referenced by column(), description(), isValid(), line(), operator=(), setColumn(), setDescription(), setLine(), setUrl(), url(), and ~QDeclarativeError().