Reputation: 405
I have a PySide2 application, which uses QML to display the user interface. The application works from the command line. I can also launch it as well as debug it in QtCreator. However, when I try to run QmlProfiler, I see the following error:
:-1: error: /home/username/code/project/venv/bin/python: Error while finding module specification for 'ljsdebugger=file:/tmp/QtCreator-kVUFuF/qtcreator-freesocket.XgLEKq,block,services:CanvasFrameRate,EngineControl,DebugMessages,DebugTranslation' (ModuleNotFoundError: No module named 'ljsdebugger=file:/tmp/QtCreator-kVUFuF/qtcreator-freesocket')
I checked project's kit settings and it is using all the defaults. I could not find any relevant articles/discussions with this error message on the web. How to resolve this issue?
Upvotes: 4
Views: 938
Reputation: 26
from PySide6.QtQml import QQmlDebuggingEnabler
debug = QQmlDebuggingEnabler()
it also useful in pyside6 , tks bro @WhiteStork
Upvotes: -1
Reputation: 405
Solving this involves two steps:
Add the line before QApplication is instantated:
from PySide2.QtQml import QQmlDebuggingEnabler
debug = QQmlDebuggingEnabler()
run the application with the command line parameter: -qmljsdebugger=port:10002,block
with the port of your choice. Then go to Analyze>QML Profiler (Attach to Waiting Application) and choose the port you started the program with:
This successfully connected the program to the QML Profiler.
Upvotes: 8