Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QML Debugging doesn't start QML profiler and don't stop at breakpoints
MoaMoaK last edited by
I've been trying to debug qml code (especially using breakpoints) for the two pas days unsuccessfully. I was wondering if someone could tell me what i did wrong.
What i've done :
First I'm using make and not qmake so i've added
CXXFLAGSvariable in my makefile.
Secondly, the program is quite huge and Qt is just a part of it. It doesn't start the QApp first. It's mainly c++ stuff loading modules and files before launching the QApp for the UI. Also, it has it's own param parser (and do not accept
-qmljsdebuggeras a valid param ^^ ) so passing the
-qmljsdebuggeroption was quite tricky but i manage to did it in two different ways :
Debugging without QML Debugging option enabled (in the Project panel) so QtCreator Debugger doesn't add the
-qmljsdebuggeroption at startup.
When the QApp is created I've hard coded (it's only for debug so it won't stay in final version)
argvvariable and the application seems to start well outputting :
QML Debugger: Waiting for connection on port 55000...
Then I quickly start the QML debugging (
Debugging > Start Debug > Attach to QML port) on port 55000 and it successfuly connects showing me various graph in the Debug panel.
Debugging with QML Debugging option enabled : I'm catching the parameter
-qmljsdebuggerbefore it's interpreted as multiple short parameters (
-l, ...) and relaying the port number up to the point where the QApp is created. At that point i'm adding
argvvariable. I've double checked the parameter i'm writing, it's the right one with the same port number as the one caught earlier.
Then everything seems alright the QMLDebug panel can show me some graphs about memory usage and statistics as with case (1)
But nevertheless, in both case, the execution doesn't stop at breakpoints even if the QML profiler seems up.
And also, i've tried to use the
console.profileEnd()functions but the program outputs in the two cases
Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX.. I'm not sure but if the qml debug interface can show me stats isn't the debug service supposed to be enabled ?
So there is my problem. Can anyone help me to get the debug working properly or see an error in what i did ? Maybe i need more than just passing the
-qmljsdebuggeroption and starting the QMLProfiler ?