内容表

上一话题

QQmlEngine

下一话题

QQmlExpression

QQmlError

QQmlError class encapsulates a QML error. 更多

Inheritance diagram of PySide2.QtQml.QQmlError

概要

函数

详细描述

QQmlError 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
											

可以使用 qDebug() , qInfo() ,或 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"
           ^
											

另请参阅

errors() errors()

class QQmlError

QQmlError(arg__1)

param arg__1

QQmlError

Creates an empty error object.

Creates a copy of other .

PySide2.QtQml.QQmlError. column ( )
返回类型

int

Returns the error column number.

另请参阅

setColumn()

PySide2.QtQml.QQmlError. description ( )
返回类型

unicode

Returns the error description.

另请参阅

setDescription()

PySide2.QtQml.QQmlError. isValid ( )
返回类型

bool

Returns true if this error is valid, otherwise false.

PySide2.QtQml.QQmlError. line ( )
返回类型

int

Returns the error line number.

另请参阅

setLine()

PySide2.QtQml.QQmlError. messageType ( )
返回类型

QtMsgType

Returns the message type.

另请参阅

setMessageType()

PySide2.QtQml.QQmlError. object ( )
返回类型

QObject

Returns the nearest object where this error occurred. Exceptions in bound property expressions set this to the object to which the property belongs. It will be 0 for all other exceptions.

另请参阅

setObject()

PySide2.QtQml.QQmlError. setColumn ( arg__1 )
参数

arg__1 int

Sets the error column number.

另请参阅

column()

PySide2.QtQml.QQmlError. setDescription ( arg__1 )
参数

arg__1 – unicode

Sets the error description .

另请参阅

description()

PySide2.QtQml.QQmlError. setLine ( arg__1 )
参数

arg__1 int

Sets the error line number.

另请参阅

line()

PySide2.QtQml.QQmlError. setMessageType ( messageType )
参数

messageType QtMsgType

设置 messageType for this message. The message type determines which QDebug handlers are responsible for receiving the message.

另请参阅

messageType()

PySide2.QtQml.QQmlError. setObject ( arg__1 )
参数

arg__1 QObject

Sets the nearest object where this error occurred.

另请参阅

object()

PySide2.QtQml.QQmlError. setUrl ( arg__1 )
参数

arg__1 QUrl

设置 url for the file that caused this error.

另请参阅

url()

PySide2.QtQml.QQmlError. toString ( )
返回类型

unicode

Returns the error as a human readable string.

PySide2.QtQml.QQmlError. url ( )
返回类型

QUrl

Returns the url for the file that caused this error.

另请参阅

setUrl()