|  | Home · All Classes · Modules

# QDeclarativeError Class Reference
[QtDeclarative module]

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

### Methods

- __init__ (self)
- __init__ (self, QDeclarativeError)
- int column (self)
- QString description (self)
- bool isValid (self)
- int line (self)
- setColumn (self, int)
- setDescription (self, QString)
- setLine (self, int)
- setUrl (self, QUrl)
- QString toString (self)
- QUrl url (self)

## 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:

     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"
                ^

## Method Documentation

### QDeclarativeError.__init__ (self)

Creates an empty error object.

### QDeclarativeError.__init__ (self, QDeclarativeError)

Creates a copy of other.

### int QDeclarativeError.column (self)

Returns the error column number.

See also setColumn().

### QString QDeclarativeError.description (self)

Returns the error description.

See also setDescription().

### bool QDeclarativeError.isValid (self)

Returns true if this error is valid, otherwise false.

### int QDeclarativeError.line (self)

Returns the error line number.

See also setLine().

### QDeclarativeError.setColumn (self, int)

Sets the error column number.

See also column().

### QDeclarativeError.setDescription (self, QString)

Sets the error description.

See also description().

### QDeclarativeError.setLine (self, int)

Sets the error line number.

See also line().

### QDeclarativeError.setUrl (self, QUrl)

Sets the url for the file that caused this error.

See also url().

### QString QDeclarativeError.toString (self)

Returns the error as a human readable string.

### QUrl QDeclarativeError.url (self)

Returns the url for the file that caused this error.

See also setUrl().