Is it possible to work with Qt4 projects in Visual Studio 2012 using add-ins?

点点圈 提交于 2019-11-30 21:58:56

Yes it is possible with the VS addin 1.2.2. I use this addin version and Qt 4.8.1 in Visual Studio 2012 together.

The addin has limitations for Qt4, but it does the whole moc and ui stuff for you.

The limitations are:

  • you must specify the Qt4 include directories and lib paths self (not clickable)
  • you have no Qt 4 file templates (but still works, after changing the include directives of the Qt4 header files according to the Qt4 file structure)

How to enable debug visualizer for Qt classes in VS2012 (Qt 4.6.x):

  1. Download and install qt-vs-addin for Qt5 for VS2012 (tested on version 1.2.2);
  2. Open Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\Debugger\autoexp.dat in editor;
  3. Uncomment QString and QByteArray sections for Qt4 and comment out (with ';') QString and QByteArray sections for Qt5;
  4. Run VS2012, open Tools->Options->Debugging->Edit and Continue. In the group box for Native-only Options, check "Enable native Editor and Continue." This will force VS to use autoexp.dat, rather than the XML-based native vis definitions (ie, the so-called "data viewing enhancements in the debugger").
  5. Profit!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!