Results 1 to 3 of 3

Thread: Qt MinGW scope

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Qt MinGW scope

    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
    Qt Code:
    1. ...
    2. enum myEnum{A = 0, B, C];
    3. ...
    To copy to clipboard, switch view to plain text mode 

    someWhere in my code
    Qt Code:
    1. int iA = myClass::myEnum::C;
    To copy to clipboard, switch view to plain text mode 

    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.
    Qt Code:
    1. int iA = myClass::C;
    To copy to clipboard, switch view to plain text mode 

    Is this behavior correct?

    Thanks,

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

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt MinGW scope

    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-integrat...rting-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).
    Last edited by Boron; 27th October 2008 at 18:43.

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt MinGW scope

    Hi,

    Thank you very much.
    Òscar Llarch i Galán

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  2. Qt + boost + MinGW on Windows
    By akos.maroy in forum Newbie
    Replies: 3
    Last Post: 12th June 2008, 14:53
  3. Just for fun game
    By vermarajeev in forum Qt-based Software
    Replies: 6
    Last Post: 13th December 2007, 21:52
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.