PDA

View Full Version : Qt MinGW scope



^NyAw^
27th October 2008, 16:10
Hi,

I'm trying to port my application from Visual Studio to Eclipse+MinGW.

I'm having some problems with enum types. On Visual Studio I was able to use:
myClass.h


...
enum myEnum{A = 0, B, C];
...


someWhere in my code


int iA = myClass::myEnum::C;


Visual Studio compiler don't show me any error, but MinGW compiler tells me that it don't exists. The only solution is ignore the enum name.


int iA = myClass::C;


Is this behavior correct?

Thanks,

Another question is: is there any tool to import from Visual Studio project to PRO file?

Thanks,

Boron
27th October 2008, 19:10
This behaviour is absolutely correct!
When you refer to an enum inside a type (class in your case), you do not need to specify the name of the enum.

Writing myClass::myEnum::C is non-standard. This might work on some compilers (e.g. MS C++ compiler accepts this, but displays a warning).
MinGW seems not to be so forgiving.

To your other question:
http://doc.trolltech.com/vs-integration-1.2/vs-integration-managing-projects.html#importing-and-exporting-projects
But this is only part of the "Qt Visual Studio .NET Integration" which is shipped with the commercial version of Qt (as far as I know).

^NyAw^
27th October 2008, 19:49
Hi,

Thank you very much.