diff --git a/.gitignore b/.gitignore index 00a1d7659..9ef6b83f8 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,7 @@ Dependencies_* # vcpkg vcpkg_installed/ + +# NatVis files +qt5.natvis +qt6.natvis diff --git a/BUILDING_ON_WINDOWS.md b/BUILDING_ON_WINDOWS.md index 8533f02fa..e0ddf877e 100644 --- a/BUILDING_ON_WINDOWS.md +++ b/BUILDING_ON_WINDOWS.md @@ -150,7 +150,6 @@ Now open the project in CLion. You will be greeted with the _Open Project Wizard ``` -DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5 -DUSE_CONAN=ON --DCMAKE_CXX_FLAGS=/bigobj ``` and the _Build Directory_ to `build`. @@ -189,3 +188,29 @@ Now you can run the `chatterino | Debug` configuration. If you want to run the portable version of Chatterino, create a file called `modes` inside of `build/bin` and write `portable` into it. + +### Debugging + +To visualize QT types like `QString`, you need to inform CLion and LLDB +about these types. + +1. Set `Enable NatVis renderers for LLDB option` + in `Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++` (should be enabled by default). +2. Use the official NatVis file for QT from [`qt-labs/vstools`](https://github.com/qt-labs/vstools) by saving them to + the project root using PowerShell: + + + +```powershell +(iwr "https://github.com/qt-labs/vstools/raw/dev/QtVsTools.Package/qt5.natvis.xml").Content -replace '##NAMESPACE##::', '' | Out-File qt5.natvis +# [OR] using the permalink +(iwr "https://github.com/qt-labs/vstools/raw/0769d945f8d0040917d654d9731e6b65951e102c/QtVsTools.Package/qt5.natvis.xml").Content -replace '##NAMESPACE##::', '' | Out-File qt5.natvis +``` + +Now you can debug the application and see QT types rendered correctly. +If this didn't work for you, try following +the [tutorial from JetBrains](https://www.jetbrains.com/help/clion/qt-tutorial.html#debug-renderers).