PySide6.QtQml.QQmlError¶
- class QQmlError¶
The
QQmlError
class encapsulates a QML error. More…Synopsis¶
Methods¶
def
__init__()
def
__repr__()
def
column()
def
description()
def
isValid()
def
line()
def
messageType()
def
object()
def
setColumn()
def
setDescription()
def
setLine()
def
setMessageType()
def
setObject()
def
setUrl()
def
swap()
def
toString()
def
url()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
QQmlError
includes a textual description of the error, as well as location information (the file, line, and column). ThetoString()
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(), qInfo(), 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" ^
See also
- __init__()¶
Creates an empty error object.
- __init__(other)
- Parameters:
other –
QQmlError
Creates a copy of
other
.- __repr__()¶
- Return type:
str
- column()¶
- Return type:
int
Returns the error column number.
See also
- description()¶
- Return type:
str
Returns the error description.
See also
- isValid()¶
- Return type:
bool
Returns true if this error is valid, otherwise false.
- line()¶
- Return type:
int
Returns the error line number.
See also
Returns the message type.
See also
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.
See also
- setColumn(column)¶
- Parameters:
column – int
Sets the error
column
number.See also
- setDescription(description)¶
- Parameters:
description – str
Sets the error
description
.See also
- setLine(line)¶
- Parameters:
line – int
Sets the error
line
number.See also
Sets the
messageType
for this message. The message type determines which QDebug handlers are responsible for receiving the message.See also
Sets the nearest
object
where this error occurred.See also
Sets the
url
for the file that caused this error.See also
- toString()¶
- Return type:
str
Returns the error as a human readable string.
Returns the url for the file that caused this error.
See also