0

当我在 Visual Studio 2008 中为 Qt 项目按“清洁解决方案”时,所有来自 generatefiles 文件夹的 moc 和 ui 头文件都被清除。
我在这个文件夹中多了一个自己生成的 *.h 文件,怎么删除呢?
moc 和 ui 头文件在哪里被删除?我找不到任何设置,可以选择添加自定义文件,但“清理时删除的扩展名”除外。但是没有关于“生成的文件”的内容。

并且Project->Properties->Configuration Properties->General->Extensions to Delete on Clean不能在这种情况下使用,因为它会忽略路径并仅识别扩展名或文件名。

4

1 回答 1

2

The Visual Studio Qt Plugin is designed to put all files generated by uic, rcc and moc into a GeneratedFiles directory. Just like you stated, if you clean out the project, all of these generated files are also removed.

The files generated will be: ui_*.h for all form files created with QtDesigner qrc_*.cpp for all resource files created with QtResource moc_*.h for all header files that contain Q_OBJECT *.moc for all .cpp files that contain Q_OBJECT

The plugin is not designed to clean out any other files that you might put there yourself because it's not intelligent enough to know what your purpose with them is.

I would suggest that you put all your own header files somewhere else and delete them manually whenever you need to.

于 2013-09-21T08:18:00.243 回答