This blog won’t be about the how (it involved a lot of cursing…), but only about the improvements made to the qt6.natvis file. Let’s see how far we can improve things here. The Qt 6 Natvis file is only 18.5 KB, which is not 50% smaller than the Qt 5 - au contraire! This means that a lot of types are not working anymore, most likely because the Qt 5 implementation didn’t work during the migration to Qt 6 due to changes in the underlying data. If you look closely at the size of the file, you can see that the Qt 5 Natvis file is 40.9 KB. If you want to use them directly from github, make sure to remove all occurrences of #NAMESPACE#. They are pre-processed and copied automatically by the plugin to %HOME%\Documents\Visual Studio 2022\Visualizers. You can download the official Qt natvis files here: Qt VS Tool github. This is already used by the Qt VS Tools for Visual Studio, with Qt 5 and a Qt 6 specific files. The Natvis framework allows developers to write custom schemas to help visualize native objects. Let’s see how to improve things… Use the Natvis Framework It was way better with Qt 5, as seen below: I don’t know about you, but for me the VS Code view is gibberish. See, for example, the debug variable view for the same project running with Qt Creator (left) and Visual Studio Code (right): On Windows, with the MSVC compiler, the debugging experience with Qt 6 can be quite frustrating for some Qt types, like QMap, QHash or QVariant. Some of us are using other IDEs, like Visual Studio, Visual Studio Code or CLion, per choice or because a project requires it. Not all Qt developers are using Qt Creator as their main IDE for development.
0 Comments
Leave a Reply. |