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"
^
参数: | arg__1 – PySide.QtDeclarative.QDeclarativeError |
---|
Creates an empty error object.
Creates a copy of other .
返回类型: | PySide.QtCore.int |
---|
Returns the error column number.
返回类型: | unicode |
---|
Returns the error description.
返回类型: | PySide.QtCore.bool |
---|
Returns true if this error is valid, otherwise false.
返回类型: | PySide.QtCore.int |
---|
Returns the error line number.
参数: | arg__1 – PySide.QtCore.int |
---|
Sets the error column number.
参数: | arg__1 – unicode |
---|
Sets the error description .
参数: | arg__1 – PySide.QtCore.int |
---|
Sets the error line number.
参数: | arg__1 – PySide.QtCore.QUrl |
---|
设置 url for the file that caused this error.
返回类型: | unicode |
---|
Returns the error as a human readable string.
返回类型: | PySide.QtCore.QUrl |
---|
Returns the url for the file that caused this error.