0

When I press "Clean Solution" in Visual Studio 2008 for a Qt project all moc and ui header files from generatedfiles folder are cleaned.
I have one more my own generated *.h file in this folder, how to delete it too?
Where moc and ui headers file are deleted? I can't find any setting, with a option to add custom file except "Extension to Delete on Clean". But there is nothing about "generatedfiles".

And Project->Properties->Configuration Properties->General->Extensions to Delete on Clean can't be used in this case, because it ignores paths and recognize only extensions or file names.

Funt
  • 399
  • 8
  • 23
  • It is not so clear what your problem is. What kind of *.h files are still in GeneratedFiles? Maybe a screenshot clarifies your question? – c_k Sep 21 '13 at 00:46
  • My problem is that I have my own `generated` header file. It is being generated whenever project is built. And I would like to remove it automatically whenever `Clean Solution` button is pressed. I put this file to `GeneratedFiles` folder. `GeneratedFiles` folder is cleaned whenever `Clean Solution` button is pressed, except my header file. That's why I am looking for a place, where cleaning of `GeneratedFiles` are set up. After answer from @RobbieE it seems that this is internal option of Qt Pluging and this setting can't be changed. – Funt Sep 23 '13 at 06:54

1 Answers1

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.

RobbieE
  • 4,280
  • 3
  • 22
  • 36
  • So, Qt plugin removes moc, ui, qrc, etc. from `GeneratedFiles` whenever when `Clean Solution` is pressed and it's not possible to tune this option, right? Than the only solution in my case is to add a path to my file to Project->Properties->Configuration Properties->General->Extensions to Delete on Clean. In this can my generated file will be still in the `GeneratedFiles` and will be removed whenever `Clean Solution` is pressed. – Funt Sep 23 '13 at 06:31
  • Unfortunately path is ignored in `Extensions to Delete on Clean`. So this option is not useful in my case. – Funt Sep 23 '13 at 08:10
  • I would like to delete this file automatically. Than if there is an error during generating of this file the project will not be built. Otherwise old version of my generated header can be used to build the project and I would like to avoid this situation. It does not matter where to store this file. I can move it to another directory. I use `Pre-Build Event` to generate this file. It seems that I need to delete it in "Pre-Build Event" just before the generation. I can't find another way... – Funt Sep 23 '13 at 08:33