5

I would like to export my Visual Studio Project to a Qt project.

How to generate a .pro file from a Visual Studio Project? I installed the Qt Add-In but I don't find such option.

cbuchart
  • 10,847
  • 9
  • 53
  • 93
X6Entrepreneur
  • 971
  • 2
  • 10
  • 30

1 Answers1

4

With Visual Studio Qt plugin installed (officially named Qt VS Tools, can be downloaded from here), just:

  1. Open your solution.

  2. Select any Qt-based project from your solution (or any file within that project).

  3. Go to menu Qt VS Tools > Create basic .pro File.... If you are using an old version of the plugin, menu may be named Qt5.

  4. Select the projects you want to export. Project tags (.pro options, only in newest plugin versions) are automatically extract from your current project, you can modify them if needed or do it later when the .pro is created.

  5. Run qmake or open it from Qt Creator.

PS: depending on your VS and Qt versions you may need an older version of the plugin. I'm assuming Qt 5 here.

Hope it helps.

cbuchart
  • 10,847
  • 9
  • 53
  • 93
  • Ooh thanks. I did not see the "Create basic .pro file" because the option is grayed out.. Do you know what could be the reason ? – X6Entrepreneur Apr 24 '17 at 10:06
  • As indicated, you have to first select a Qt-based project in your solution (of course, you have to open the solution first). – cbuchart Apr 24 '17 at 10:07
  • Ooh ok, so I think my solution is not a QT based project.. I thought it will be possible to convert a non QT based project to a QT project ! – X6Entrepreneur Apr 24 '17 at 10:09
  • You can, but it is a manual procedure, see this [answer here for Qt 4](http://stackoverflow.com/questions/2088315/how-to-convert-a-regular-win32-vc-vcproj-project-to-a-qt-project). I haven't found an answer for Qt 5, but you can create a new Qt project and then see the differences in the `.vcxproj` files. – cbuchart Apr 24 '17 at 10:13
  • @cbuchart Which project tag should be used? – C. Binair Oct 24 '19 at 12:53
  • @C.Binair I've update the answer to cover such new field, which was not available in the version of the plugin used 2.5 years ago ;) – cbuchart Oct 24 '19 at 12:59