[Qt-interest] moc .cpp file in visual studio

David Ching dc at remove-this.dcsoft.com
Tue Jun 30 06:40:46 CEST 2009


<Oliver.Knoll at comit.ch> wrote in message 
news:C10F29AB06447B4881FC0DE1E302E2F2E92F97C4 at sg000036.corproot.net...
> At least the VS 2005 Express does not for sure, don't know about the VS 
> 2008 Express version. But I would be surprised if it would support 
> plugins.
>

VS 2008 Express doesn't support plug-ins either.


> (Note that previously there were separate tools called "Qt Visual Studio 
> AddOn" and "Qt Visual Studio Integration" - not sure if they still exist 
> in parallel. I always got confused, but from what I remember the "AddOn" 
> would simply provide the moc'cing/uic'ing steps and also still worked with 
> Qt 3 (and 4, off course), whereas the "Integration" also embedded the Qt 
> Designer etc. into Visual Studio (and only supported Qt 4)).
>

They still do exist in parallel.  The Add On is the one freely available; 
the VS Integration is the commercial-only one.  The latest Add On has 
knowledge of .ui files and will launch the external Qt Designer when 
double-clicked.  I don't think there is any real benefit of the VS 
Integration one any longer, and the download page for the Add-on states it 
is meant to be used for both (L)GPL AND Commercial.


> Alternativelly you edit the *.h to be mock'ed MANUALLY and type in the 
> necessary POST-BUILD steps (or was it Custom compile steps? Can't 
> remember...). The easiest thing would probably be to create a dummy 
> project with at least one *.ui and *.h to be mocked, and let "qmake -t 
> vcapp" create a Visual Studio project for you. Then see how the *.h files 
> are custom-compiled and copy/adapt that code in your own Visual Studio 
> project. It is a PAIN, but it works (and don't forget to manually add the 
> gener
> ated moc_*.cpp etc. files to your project as well, otherwise you'll get 
> linker errors!).
>

The Add-On adds a Qt menu to VS, and one of the items is Open .PRO file (or 
something similar to that).  I believe that does the equivalent of 
"qmake -t".


Thanks,
David 




More information about the Qt-interest-old mailing list