2

我有一个相当大的项目,它是用 Qt 用 C/CPP 开发的。每次我更改 .pri 或 .pro 文件中的设置时,我都必须使用 qmake 转换项目。

我这样做:

qmake -spec win32-msvc2012 -tp vc $projectName.pro

之后,我在 Visual Studio (2012) 中重新加载项目。

当我每次重新生成所有“moc”文件并且整个项目编译/重建时,我都构建项目。有没有一种方法可以重新编译更改/新包含的文件?

4

1 回答 1

2

你应该使用Visual Studio Add-In for Qt 5. Qt 4 也有一个,尽管旧版本 (1.1.11) 不支持 VS 2012。您可以在此处找到有关此的最新博客文章:

http://blog.qt.digia.com/blog/2013/04/11/visual-studio-add-in-1-2-1-for-qt-5-released/

除其他外,您将获得比您在此处编写的内容更多的功能。有关最新版本,请参阅此更改日志:

Qt Visual Studio 插件版本 1.2.1 包含多个错误修复和改进。

Changes
-------
- Qt 5.0.1 help documents included
- Qmake wrapper COM component removed and replaced with command line tool
  qmakefilereader to avoid need to load Qt5 library binaries to Visual Studio
  process. And to get installation of add-in easier, specially with VS2008.
- Qt4 add-in is not allowed to run same time, if found it will be closed.
  Also if Qt4 add-in is present in system, default editor values for .ts, .ui
  and .qrc file types are not permanently overwritten by Qt5 add-in. Values are
  written when Qt5 add-in loads and Qt4 values are set when Qt5 add-in unloads.
  This should make it possible to install and use both Qt4 and Qt5 versions of
  add-in. Not to use same time but in turns. Though user must be careful what he
  does.
- Recognizing Qt5 CE build. (QTVSADDINBUG-153)
- Incorrect additional directories paths set when Qt modules added/removed from
  Qt Project Settings page. (QTVSADDINBUG-151)
- Include directories search path for some Qt modules fixed (QTVSADDINBUG-150)
- Invalid Qt module names fixed (QTVSADDINBUG-142)
- Crash when importing .pri file fixed (QTVSADDINBUG-139)
- Qt default settings saving problem fixed (QTVSADDINBUG-137)
- Naming of precompiled header fixed (QTVSADDINBUG-132)
- Support for debugger visualizers in VS2012 (QTVSADDINBUG-129)
- Setting Qt libraries path for debugging session fixed (QTVSADDINBUG-125)
于 2013-09-27T18:41:56.220 回答