I have a QT project that loads a QML project. I've have no problem debugging the QML part of the program when I run it from QT Creator. I've added
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
to my CMakeLists.txt and checked the "Enable QML" under "Debugger Settings" in "Project->Run"
But I would like to debug from Visual Studio, since that is the environment we usually work in.
Is it possible to manually do what QT Creator does when you check the "Enable QML" box, to activate debugging from Visual Studio? Attach to some process or similar?
I've tried to figure out what the "Enable QML" box actually does. But I've not been able to find any good explanation about this.
We use CMake to build, MSVC as compiler and CDB as debugger. The projects are in QT5.5 and QT Quick 2. Visual Studio is version 2015 Professional and QT Creator is version 4.1.0.
In the Run Settings, Debugger Settings section, select the Enable QML check box to enable QML debugging. Select Build > Rebuild Project to clean and rebuild the project.
QMK (Quantum Mechanical Keyboard) is an open source community centered around developing computer input devices. The community encompasses all sorts of input devices, such as keyboards, mice, and MIDI devices.
This can be used to execute script code at startup, once the full QML environment has been established. The onCompleted signal handler can be declared on any object. The order of running the handlers is undefined. Rectangle { Component. onCompleted: console.
As mentioned, the QML debugging feature of the Qt VS Tools will be available in the next version, scheduled for release in the Visual Studio Marketplace later this year. A preview version will shortly be available for download on the Qt website; we'll post a quick update here when it is available.
QML debugging is enabled by default for any Qt QML application. It is possible to disable QML debugging, and revert to native-only debugging, by opening the Qt project settings dialog and setting the "QML Debug" option to "Disable". In this dialog, it is also possible to change the port that is used by the QML debugging runtime.
The short answer to this question is: Use both. While Code is a great development tool, it is not meant to replace a full IDE that offers in-depth support and tools for a specific framework. In contrast to Qt Creator, Visual Studio Code strictly focuses on the necessary tools for efficient source code editing, and it excels at that.
You can also use the keyboard shortcut Ctrl+Shift+D. The Run view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings. If running and debugging is not yet configured (no launch.json has been created), VS Code shows the Run start view.
Since Qt Visual Studio tools 2.3, released in Oct 2018, the QML debugger is included and usable from Visual Studio :)
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