This repository contains:
- Up to date natvis files for Qt5 and Qt6
- Command line tool to install or update them in different locations
natvis4qt
is a simple command line tool to install or update the natvis files in different locations.
Caution
The tool is in early stage, for now it can only overwrite natvis file in known locations. More later!
Installation via Scoop (preferred)
scoop bucket add narnaud https://github.com/narnaud/scoop-bucket
scoop install natvis4qt
During a scoop update, installed Natvis files will be automatically updated. If you don't want this mechanism, run:
natvis4qt set --autoupdate false
- Go to the Releases page
- Download the latest
natvis-x86_64-pc-windows-msvc.zip
file - Extract the files from it into a directory.
Just run natvis4qt install
on the command line and follow the instructions.
The application is using different commands:
install
Install the natvis files in known directories (MSVC and Qt)update
Update the natvis filesset
Adjust natvis4qt's settings
Normally you don't have to do anything, the natvis files are copied in a central place that is used by Visual Studio.
See documentation here: Natvis file locations
Some visulaizers require debug symbols for Qt to be loaded. To load them, add the bin
directory of your Qt installation (e.g. C:\Qt\6.8.0\msvc2022_64\bin
) to the symbol search path under Options > Debugging > Symbols.
In order to use this natvis file in VS Code, you need to add a visualizerFile
to your launch configuration. Edit your launch.json
file (or the launch
section of your *.code-workspace
file) and add something like that:
"configurations": [
{
"name": "Current Target (VS)",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"visualizerFile": "${env:QTDIR}/natvis/qt6.natvis",
"cwd": "${workspaceFolder}",
"sourceFileMap": {
"C:/work/build/qt5_workdir/w/s": "${env:QTDIR}/../Src",
"Q:/qt5_workdir/w/s": "${env:QTDIR}/../Src",
"C:/Users/qt/work/install": "${env:QTDIR}/../Src",
"C:/Users/qt/work/qt": "${env:QTDIR}/../Src"
},
"symbolOptions": {
"searchPaths": ["${env:QTDIR}/bin"],
}
}
]
Important
The QTDIR
environment variable must be set up before launching VS Code
If you are only interested in natvis files, you can find them here:
Warning
Do not use the natvis files in the source repository, as they are merged during the release. Always use the one from the release.
You can find the current status of natvis definitions here: SUPPORT.md
The natvis4qt tool is licensed under the MIT license.
qt5.natvis
:
- The Qt Company: licensed Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
qt6.natvis
:
- The Qt Company: licensed Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
- QMap, QHash, QSet and QVariant are copyright Klarälvdalens Datakonsult AB (KDAB)
qt6-extension.natvis
:
- @nholthaus: licensed MIT
- Klarälvdalens Datakonsult AB (KDAB): licensed MIT
- @nerixyz: licensed MIT