Qt Creator, pyside6, QML debuggger
-
Hello everyone,
I can't find enough information about how to work the QML debugger in a PySide6 project.
This is what I found that is related a C++ Qt project.
[https://doc.qt.io/qtcreator/creator-debugging-qml.html]
I tried the below link and also tried "attach to QML port" but It didn't work.
https://doc.qt.io/qtforpython-6/overviews/qtquick-debugging.html
-
QML debugging needs to be enabled in the app by something like
from PySide6.QtQml import QQmlDebuggingEnabler QQmlDebuggingEnabler.enableDebugging(True)
This should be removed when shipping the code though for security reasons.
-
@friedemannkleint I'll try it out and get back tomorrow. Thanks!
-
@friedemannkleint said in Qt Creator, pyside6, QML debuggger:
QQmlDebuggingEnabler.enableDebugging(True)
Unfortunately this made no difference actually. When you use QTCreator to run in debug mode you will get this message.
Message might seem self explanatory but turns out QT Creator does not have this option inside of the "Build" under project.
I've searched for this option all over else where through out the program to no avail.
"Run" does have it, but makes no difference since it wants it in both options checked, but it's impossible to do so for pyside6.
-
Good news is VSCode has no problem at least showing the output in the terminal by default where as QT Creator fails to show anything of relevance at all as far as debugging. Granted this is due to just running the script via
python main.py
and if I did this manually in QT Creator it would have the same output. -
Whether Qt Creator shows sth in the console might be influenced by the buffered output option of python3 (pass -u to python3 [-u : force the stdout and stderr streams to be unbuffered, or set PYTHONUNBUFFERED=1]). This should also be available in the run settings. Are these breakpoints from C++ maybe - Qt Creator sometimes remembers breakpoints.