13

I used to google a lot about it.

  • I enabled Debugging -> Edit and Continue in Native Only options
  • I was trying to add Visualizers to Visual Studio 2013\Visualizers
  • vstools project on codeplex is not for 2013 seems like

but so far nothing helps...

cnd
  • 32,616
  • 62
  • 183
  • 313
  • 1
    have you tried the [Visual Studio Add-in](http://wiki.qt.io/QtVSAddin)? also have a look at https://wiki.qt.io/IDE-debug-helpers#MS_Visual_Studio_2013 – m.s. Apr 20 '15 at 10:23
  • @m.s.yes, seems like 2010 is last supported version there http://code.qt.io/cgit/qt-labs/vstools.git/tree/Qt4VS2003/createUserFiles.pl – cnd Apr 20 '15 at 10:24
  • 3
    some more links, that should help: http://forum.qt.io/topic/34189/qt-in-visual-studio-2013/2 and http://download.qt.io/official_releases/vsaddin/qt-vs-addin-1.2.4-opensource.exe.mirrorlist – m.s. Apr 20 '15 at 10:28
  • @m.s. I installed it, added qt to it but still I can't see QString content... – cnd Apr 20 '15 at 10:36
  • I recommend using this pre-built addon: [VS 2013 addin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools) – jrh Jun 09 '20 at 15:33

4 Answers4

9

There is an explicit, native MSVC solution without the use of plugins etc.: see my answer from here

Say you have QString str, then add to the debugger session watch window:

Qt4:

((str).d)->array,su 

for Qt5 it's slightly more complicated:

(char*)str.d + str.d->offset,su
DomTomCat
  • 8,189
  • 1
  • 49
  • 64
1

I search this problem's answer for a long time, and final success saw the QString content by try check/uncheck mentioned options. Hope can help others.

Screenshot: display qstring content

  1. Install qt-vs-addin-msvc2013-2.0.0-beta.vsix
  2. Uncheck TOOLS->Debugging->Edit and Continue->Enable native Edit and Continue
    Screenshot: Uncheck TOOLS->Debugging->Edit and Continue->Enable native Edit and Continue
li ki
  • 342
  • 3
  • 11
tiegeda
  • 121
  • 4
  • Thank you for supplying the full path to the "Enable native Edit and Continue" setting and screenshot. That helped me. – Joachim Apr 24 '17 at 13:49
1

I know this question is a while back but if relevant, for VS 2013 then go to

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\Debugger\Visualizers"

and add Code from below link in a text file and name it qt5.natvis. For VS 2019 the location would be:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Packages\Debugger\Visualizers"

Hope this helps.

pastebin code for seeing qt variables in visual studio

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Sam
  • 31
  • 2
0

Managed to see QString content by disabling Debugging -> Edit and Continue

not sure if there could be better solutions

cnd
  • 32,616
  • 62
  • 183
  • 313