cnd
cnd

Reputation: 33754

Display QString (Qt5) content in Visual Studio 2013 debugging?

I used to google a lot about it.

but so far nothing helps...

Upvotes: 13

Views: 10539

Answers (4)

tiegeda
tiegeda

Reputation: 131

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

Upvotes: 1

Sam
Sam

Reputation: 41

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

Upvotes: 1

DomTomCat
DomTomCat

Reputation: 8569

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

Upvotes: 9

cnd
cnd

Reputation: 33754

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

not sure if there could be better solutions

Upvotes: 0

Related Questions