[英]Display QString (Qt5) content in Visual Studio 2013 debugging?
I used to google a lot about it. 我曾经谷歌很多关于它。
Visual Studio 2013\\Visualizers
Visual Studio 2013\\Visualizers
but so far nothing helps... 但到目前为止没有任何帮助
There is an explicit, native MSVC solution without the use of plugins etc.: see my answer from here 有一个明确的本机MSVC解决方案,不使用插件等。 请参阅我的答案
Say you have QString str
, then add to the debugger session watch window : 假设您有
QString str
,然后添加到调试器会话监视窗口 :
Qt4 : Qt4 :
((str).d)->array,su
for Qt5 it's slightly more complicated: 对于Qt5来说,它稍微复杂一点:
(char*)str.d + str.d->offset,su
I search this problem's answer for a long time, and final success saw the QString content by try check/uncheck mentioned options. 我长时间搜索这个问题的答案,最后的成功通过尝试检查/取消选中提到的选项来查看QString内容。 Hope can help others.
希望可以帮助别人。
display qstring content 显示qstring内容
Managed to see QString
content by disabling Debugging -> Edit and Continue
通过禁用
Debugging -> Edit and Continue
来管理以查看QString
内容
not sure if there could be better solutions 不确定是否有更好的解决方案
I know this question is a while back but if relevant, for VS 2013 then go to 我知道这个问题有一段时间了,但如果相关的话,对于VS 2013则转到
"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. 并在文本文件中添加来自以下链接的代码并将其命名为qt5.natvis。 For VS 2019 the location would be:
对于VS 2019,位置将是:
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 用于在visual studio中查看qt变量的pastebin代码
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.