QDeclarativeError

概要

函数

详细描述

PySide.QtDeclarative.QDeclarativeError class encapsulates a QML error.

PySide.QtDeclarative.QDeclarativeError includes a textual description of the error, as well as location information (the file, line, and column). The PySide.QtDeclarative.QDeclarativeError.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
									

可以使用 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"
           ^
									
class PySide.QtDeclarative. QDeclarativeError
class PySide.QtDeclarative. QDeclarativeError ( arg__1 )
参数: arg__1 PySide.QtDeclarative.QDeclarativeError

Creates an empty error object.

Creates a copy of other .

PySide.QtDeclarative.QDeclarativeError. column ( )
返回类型: PySide.QtCore.int

Returns the error column number.

PySide.QtDeclarative.QDeclarativeError. description ( )
返回类型: unicode

Returns the error description.

PySide.QtDeclarative.QDeclarativeError. isValid ( )
返回类型: PySide.QtCore.bool

Returns true if this error is valid, otherwise false.

PySide.QtDeclarative.QDeclarativeError. line ( )
返回类型: PySide.QtCore.int

Returns the error line number.

PySide.QtDeclarative.QDeclarativeError. setColumn ( arg__1 )
参数: arg__1 PySide.QtCore.int

Sets the error column number.

PySide.QtDeclarative.QDeclarativeError. setDescription ( arg__1 )
参数: arg__1 – unicode

Sets the error description .

PySide.QtDeclarative.QDeclarativeError. setLine ( arg__1 )
参数: arg__1 PySide.QtCore.int

Sets the error line number.

PySide.QtDeclarative.QDeclarativeError. setUrl ( arg__1 )
参数: arg__1 PySide.QtCore.QUrl

设置 url for the file that caused this error.

PySide.QtDeclarative.QDeclarativeError. toString ( )
返回类型: unicode

Returns the error as a human readable string.

PySide.QtDeclarative.QDeclarativeError. url ( )
返回类型: PySide.QtCore.QUrl

Returns the url for the file that caused this error.