问题描述
我使用Visual Studio 2012和Qt4.8.5,不幸的是,当我在调试模式下工作时,我看不到QString文本变量.有人允许小费吗? VS2012不存在Qt4.8.5插件.
I use visual studio 2012 and Qt4.8.5, unfortunately I can not see the QString text variable when I work in debug mode. Is someone has a tip allow it ? Qt4.8.5 plug-in doesn't exist for VS2012.
非常感谢
泽维尔
推荐答案
有一个快速而明确的解决方案(MSVC本机,无需插件,也无需设置.dat文件),
There is a quick and explicit solution (MSVC native, no need for plugins nor setting up .dat files), see my answer from here
假设您拥有QString str
( Qt4 ),然后将其添加到调试器监视窗口:
Say you have QString str
(Qt4), then add to the debugger watch window:
((str).d)->array,su
附录,su
告诉调试器将数据解释为unicode和以空终止的字符串.
the appendix ,su
tells the debugger to interpret the data as unicode and null terminated string.
注意:对于 Qt5 QString str
,可能是
(char*)str.d + str.d->offset,su
这篇关于Visual Studio 2012和Qt4.8.5:如何在调试模式下查看QString内容.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!