April 12, 2012

auric auric
Lab Rat
8 posts

Visual Studio MFC project in Qt Creator

 

How can I open and compile Visual Studio MFC project (and solution) in Qt Creator?

10 replies

April 12, 2012

veeraps veeraps
Lab Rat
87 posts

I wonder – is that possible in Qt Creator.

The other way is possible i.e., a .PRO file can be opened and compiled on Visual Studio.

~veeraps

April 12, 2012

auric auric
Lab Rat
8 posts

I know about it. And I’d like to know is it possible to open Visual Studio files under Qt Creator in any way?

April 12, 2012

Tobias Hunger Tobias Hunger
Mad Scientist
3224 posts

I am not aware of a way to do so. You can create a dummy .pro file using “qmake -project” and open that in Qt Creator and then reconfigure the build configuration to actually use msbuild for its work.

April 12, 2012

SteveKing SteveKing
Lab Rat
105 posts

You could load the project into Visual Studio, and then export it to a .pro file using the VS plugin. This is kind of a one way process and the .pro file it produces might need some hand crafting.

April 12, 2012

auric auric
Lab Rat
8 posts
SteveKing wrote:
You could load the project into Visual Studio, and then export it to a .pro file using the VS plugin. This is kind of a one way process and the .pro file it produces might need some hand crafting.

It’s not possible for any project except projects using Qt. I have MFC project (without Qt libraries), how can it be exported?

April 12, 2012

mlong mlong
Mad Scientist
1517 posts

In the .pro file that’s generated, just add the line

  1. CONFIG -= qt

to remove the Qt dependencies.

(There may be something else you have to do… others will jump in and comment if there is.)

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 12, 2012

auric auric
Lab Rat
8 posts

No. Sorry, there is some misunderstanding. Plugin wont generate any .pro file if current project is not Qt project. There is menu ‘Create basic .pro File’, which is only active while current project is using Qt. Or am I get something wrong?

April 12, 2012

mlong mlong
Mad Scientist
1517 posts

There’s always the tried-and-true method of using

  1. qmake -project

as documented here to generate a .pro file from a collection of source files. It’s not the same as porting from a VS project file, but it’s an option.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 13, 2012

auric auric
Lab Rat
8 posts

Thanks. But if I have about 100 projects and their files collected in many subdirs (which have sometimes subdirs too)?..

Yes. I can use

  1. qmake -project -r

I also can write some script. Thanks, mlong, you gave me a good idea. The most problematic is to port options of solution and projects, but that’s non Qt side :)

April 13, 2012

mlong mlong
Mad Scientist
1517 posts

Be aware that .pro files support the SUBDIRS template, which can be useful for nested projects. The docs talk about those, too.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

 
  ‹‹ [SOLVED] Force qtcreator to rebuild objects from modified template header files      Is it possible to debug shared libraries on Symbian with Qt Creator? ››

You must log in to post a reply. Not a member yet? Register here!