QQmlError¶
The QQmlError
class encapsulates a QML error. More…
Synopsis¶
Functions¶
def
__repr__
()def
column
()def
description
()def
isValid
()def
line
()def
messageType
()def
object
()def
setColumn
(arg__1)def
setDescription
(arg__1)def
setLine
(arg__1)def
setMessageType
(messageType)def
setObject
(arg__1)def
setUrl
(arg__1)def
toString
()def
url
()
Detailed Description¶
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
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
errors()
errors()
- class PySide6.QtQml.QQmlError¶
PySide6.QtQml.QQmlError(arg__1)
- Parameters
arg__1 –
PySide6.QtQml.QQmlError
Creates an empty error object.
Creates a copy of other
.
- PySide6.QtQml.QQmlError.__repr__()¶
- Return type
object
- PySide6.QtQml.QQmlError.column()¶
- Return type
int
Returns the error column number.
See also
- PySide6.QtQml.QQmlError.description()¶
- Return type
str
Returns the error description.
See also
- PySide6.QtQml.QQmlError.isValid()¶
- Return type
bool
Returns true if this error is valid, otherwise false.
- PySide6.QtQml.QQmlError.line()¶
- Return type
int
Returns the error line number.
See also
- PySide6.QtQml.QQmlError.messageType()¶
- Return type
QtMsgType
Returns the message type.
See also
- PySide6.QtQml.QQmlError.object()¶
- Return type
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
- PySide6.QtQml.QQmlError.setColumn(arg__1)¶
- Parameters
arg__1 – int
Sets the error column
number.
See also
- PySide6.QtQml.QQmlError.setDescription(arg__1)¶
- Parameters
arg__1 – str
Sets the error description
.
See also
- PySide6.QtQml.QQmlError.setLine(arg__1)¶
- Parameters
arg__1 – int
Sets the error line
number.
See also
- PySide6.QtQml.QQmlError.setMessageType(messageType)¶
- Parameters
messageType –
QtMsgType
Sets the messageType
for this message. The message type determines which QDebug
handlers are responsible for receiving the message.
See also
- PySide6.QtQml.QQmlError.setObject(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QObject
Sets the nearest object
where this error occurred.
See also
- PySide6.QtQml.QQmlError.setUrl(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QUrl
Sets the url
for the file that caused this error.
See also
- PySide6.QtQml.QQmlError.toString()¶
- Return type
str
Returns the error as a human readable string.
- PySide6.QtQml.QQmlError.url()¶
- Return type
Returns the url for the file that caused this error.
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.