How to convert a regular win32 (VC++ vcproj) project to a Qt project?

后端 未结 5 1217
南方客
南方客 2020-12-24 13:17

How can I convert existing vcproj files to project files that the QT add-in to Visual Studio recognizes and treats as valid Qt projects?

Should I just bite the bull

5条回答
  •  轮回少年
    2020-12-24 13:32

    Using Visual Studio 2010+ it is now possible to convert a project to a Qt Addin project, using the "Convert project to Qt Add-in project" feature of the Qt Addin.

    The following steps are from the work around in bug QTVSADDINBUG-27. This was tested with Visual Studio 2010, but should work similarly with new versions:

    1. Right click on your project in "Solution Explorer", click on "Unload Project"
    2. Right click on your project in "Solution Explorer", click on "Edit .vcxproj"
    3. Add line Qt4VSv1.0 between the tags and .
    4. Right click on your project in "Solution Explorer", click on "Reload Project"
    5. Right click on your project in "Solution Explorer", click on "Convert project to Qt Add-in project"

    If you have header files in your project you are going to have to follow the instructions in this answer to trigger the generation of moc_* files in the "Generated Files" folder.

    For editions of Visual Studio older than 2010 see this work around.

提交回复
热议问题