With Qt 4.8, this has become pretty easy. All the necessary libraries are now part of Qt itself, and you do not need to create your own debug library for your version of Qt.
I am developing a Qt / QML desktop application also built with CMake. I had to follow these steps to enable QML debugging:
Include the debugging tool in the application startup code
#include <QtDeclarative/qdeclarativedebug.h> /* [...] */ QDeclarativeDebuggingEnabler enabler;
Add QML_DISABLE_OPTIMIZER=1 to my application runtime
This can be done in Qt Creator on the runtime tab of the project page.
Check the box for debugging QML, also found on the runtime tab.
This adds the required command line options for communication between Qt Creator and the QML debugging component built into the application.
If everything goes well, the application welcomes you with the following output if it is running in debug mode:
Qml debugging is enabled. Use it only in a safe environment!
QDeclarativeDebugServer: Waiting for connection on port 3768 ...
QDeclarativeDebugServer: connection established
After that, I was able to set breakpoints and check the variables. I also worked on the profiler, accessible through the analysis page.
Your case is obviously a little more complicated as you are developing an embedded application.
Qt creator does not support the deployment and execution of CMake-based projects on embedded platforms. You will have to do it yourself. Remember to pass the necessary arguments to your application to configure QML debugging:
$ your-app -qmljsdebugger=port:3768,block
To attach Qt Creator to remote launch of the application for the profiling session, use the corresponding “External” entries in the “Analysis” menu in the Qt Creator main menu. Where is a similar debugging option with "Connect to Debug-Server" under "Debug"> "Debug".
sebasgo
source share