Pyqt Qml Error Console Missing
The title says pretty much everything. Lets say I have this simple application: main.py >>> import sys from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QApplicati
Solution 1:
If all you want is to see error output on the console, you don't need to do anything, because Qt automatically does that anyway. For example, if I change height
to heigth
in your example, the following message is printed on stderr:
file:///home/foo/test/main.qml:4:17: Cannot assign to non-existent property "heigth" width: 250; heigth: 175
If you want to raise an exception within your application, you can connect to the statusChanged signal and get the details from the errors method:
def handleStatusChange(status):
if status == QQuickView.Error:
errors = appLabel.errors()
if errors:
raise Exception(errors[0].description())
appLabel = QQuickView()
appLabel.statusChanged.connect(handleStatusChange)
Post a Comment for "Pyqt Qml Error Console Missing"