[Solved] [How?] Generate moc files automatically using Visual Studio 2008
-
wrote on 11 May 2011, 11:53 last edited by
Hello guys
I have a simple question. :)
Is there some way to configure Microsoft Visual Studio 2008 to automatically generate and use moc files every time I add the Q_OBJECT macro in a class? Right now this is done when I create my Visual Studio project as a "Qt Application" but not when I have a simple 'Win32 Project' or 'Win32 Console Application'. What project properties I should add to the last two types of projects, in order to generate automatically the moc files?Thank you in Advance!
-
wrote on 11 May 2011, 12:37 last edited by
Can you say why you don't want to use Qt App projec template? Are there any reasons for it?
-
wrote on 12 May 2011, 08:24 last edited by
Heya,
Thank you for your reply dude. Well, there is no any very serious reason for it. I just want to know how to do it without the Qt Application project template.Cheers
[quote author="Denis Kormalev" date="1305117479"]Can you say why you don't want to use Qt App projec template? Are there any reasons for it? [/quote]
-
wrote on 12 May 2011, 11:28 last edited by
You can add some preparation and compilation steps manually. There is no help from other tools.
Just go with a Qt project and you're done.
You can always analyze a VS project file with Qt support enabled. It's just an XML file.
-
wrote on 13 May 2011, 10:21 last edited by
Thanks for your reply Volker.
Indeed I found a guide explaining how to configure the project settings for the thing I ask. Although, I might have a look at the project files when I find some free time to see how the Qt App template works.
Thanks again for your help guys! -
wrote on 13 May 2011, 10:23 last edited by
I've never done that manually, but always used the VS addin for the "dirty work" (I'm lazy regarding such stuff :) )
-
wrote on 13 May 2011, 10:26 last edited by
And it is really dirty, as you have to deal with all the compiler defines etc.
You can also just add some xml stuff in thge end of the vcproj file and the plugin does all for you, even if it was not created with the qt templates.
1/7