I have a Qt (5.8.0) project using QML files. I would like to set breakpoints in the QML file using Qt creator (4.2.1) so I can follow the flow. However I cannot get it to work. I have enabled "Enable QML debugging and profiling" in the qmake build step and "Enable C++" and "Enable QML" in the run step.
The breakpoints in the C++ code are hit, but the QML are ignored. When starting I get the following message:
QDeclarativeDebugServer: Ignoring
\"-qmljsdebugger=port:42715,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector\".
Debugging has not been enabled.
When I try to debug QML files in demo projects like "Calendar" with the same kit it does work and breakpoints are hit.
Any ideas?
Did you enable the QML Debugger in your code? I remember putting something like this into my code:
For Qt4:
#include <QtDeclarative/qdeclarativedebug.h>
QDeclarativeDebuggingEnabler qmldbg;
or in case of Qt5:
#include <QQmlDebuggingEnabler>
QQmlDebuggingEnabler enabler;
Also QML debugging needs to be activated in the Execution Settings:
I had to remove a package from my .pro file:
#CONFIG += qtquickcompiler
With this line commented out and confirming my project's build steps: "Enable QML debugging and profiling" was checked, the breakpoints worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With