我可以自定义autoexp.dat以在Visual Studio 2010调试器中启用QT QDomNode的可视化吗 [英] Can I customize autoexp.dat to enable visualization of a QT QDomNode in Visual Studio 2010 Debugger

查看:78
本文介绍了我可以自定义autoexp.dat以在Visual Studio 2010调试器中启用QT QDomNode的可视化吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在Visual Studio 2010中进行QT开发.我希望能够在Visual Studio调试器中看到QDomNode变量的内容.

We are doing QT development in Visual Studio 2010. I would like to be able to see the contents of A QDomNode variable in the Visual Studio Debugger.

可以通过自定义autoexp.dat文件来自定义Visual Studio调试器中变量的显示. Visual Studio的QT加载项添加了许多对autoexp.dat的自定义,使您能够查看有关QT类的信息,关于自定义autoexep.dat的讨论很多,其中包括对QDomNode的自定义,这些自定义似乎源自此

It is possible to customize the display of variables in the Visual Studio Debugger by customizing the autoexp.dat file. The QT Add in for Visual Studio adds many customizations to autoexp.dat that enable you to see relevant information for QT classes, and there are a number of discussions on customizing the autoexep.dat that include a customization for QDomNode that appear to originate from this Daniel Albuschat blog entry QT Debugging with Visual Studio 2005. However, QDomNode is still not visible to me even with the described modifcations to autoexp.dat.

我注意到QDomNode使用成员变量QDomNodePrivate * impl作为PIMPL来隐藏其数据成员.这类似于QT中常用的"d"指针,尤其是QString中的"d"指针,它能够正确查看数据...任何指针都将不胜感激...

I notice that QDomNode uses a member variable QDomNodePrivate* impl as a PIMPL to hide its data members behind. This is similar to the "d" pointer commonly used in QT, notably in QString, which is able to see data correctly... Any pointers would be appreciated...

推荐答案

一个简单的预览是:

QDomNode|*::QDomNode{
    preview         ($e.impl->name)
}

但这实际上并没有用,因为调试器仅在impl位于内部"时才能看到impl的结构,qdom.cpp包含QDomNodePrivate的定义.您可以通过进入一些QDom方法来对此进行测试.一种"hacky"解决方案是将QDomNodePrivate的类定义复制到您包含在程序中的某些头文件中.

But this does not really work, because the debugger can see the structure of impl only when it is "inside" qdom.cpp wich contains the definition of QDomNodePrivate. You can test this by stepping inside some QDom method. One "hacky" solution would be to copy the class definition of QDomNodePrivate into some header file that you include in your program.

别忘了:您必须是管理员才能成功编辑autoexp.dat!

And don't forget: You have to be Administrator to successfully edit autoexp.dat!

这篇关于我可以自定义autoexp.dat以在Visual Studio 2010调试器中启用QT QDomNode的可视化吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆