Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Moving from Visual Studio 2010 to Qt Creator 2.8.1

Moving from Visual Studio 2010 to Qt Creator 2.8.1

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 8.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TOAOMatis
    wrote on last edited by
    #1

    Hi Guys,

    This is my very first Qt forum post, so when I don't comply to the standards, please let me know.

    Currently I'm given a project which is completely developed in Visual Studio 2010. I have a licensed version of Visual Studio 2010 c++ and I've already installed the Qt plugin 1.2.2 opensource. The Qt5 entry shows in the default VS2010 menu bar. So that seems to work.
    While I have quite some experience with Qt5 and Qt Creator (2.8.1), I want to move my complete project from Visual Studio 2010 to Qt Creator 2.8.1
    In my case it doesn't matter which compiler I use, as long as I can run this application on Windows 7 x64 (same OS as where I'm developing on).

    The problem is that I can't find a way to convert the VS2010 project (files) to Qt and Qt Creator format.
    In VS2010 the option to "Convert projects to QMake generated projects" is grayed out. When I right click on the project entry in my Solution Explorer, all Qt related actions are grayed out as well.

    While this is an one-time only migration, I am willing to do this by hand. There aren't a lot of files; 50 classes maximum. So my question is:

    Where can I start with this migration? So I can edit, compile, debug and release from Qt Creator?
    At this moment, there is no need to use the Qt library instead of the Windows one.

    Many thanks in advance,

    TOAOMatis

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Run this in your project:
      @
      qmake -project
      @

      This should generate a project file for you. Don't treat this as "job done", though, you need to adjust the file to your needs. But the tedious heavy lifting will be done.

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TOAOMatis
        wrote on last edited by
        #3

        Thanks for your reply. I ran the command you suggested and it indeed generated the .pro file with all the cpp- and h-files that where in the directory.

        Although I'm using the MSVC2010 compiler, I get lots of compiler issues. All are type casting related.

        I have a CStringArray named m_strArray (bad choice of naming convention, but that's not the problem at the moment).
        This array is called a gazillion times in my application:
        @
        /// CStringArray of grid column data
        CStringArray m_strArray;
        /***/
        inline LONG GetAtLong(int nCol)
        {
        if( nCol < m_strArray.GetSize() )
        return atol(m_strArray.GetAt(nCol));
        return 0;
        }@

        This generates the following compiler error:
        @ACPDefines.h:283: error: C2664: 'atol' : cannot convert parameter 1 from 'const CString' to 'const char *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called@

        Are there some includes / typedefs which translates the Windows specifics to Qt specifics?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          This has nothing to do with Qt... CString comes from Microsoft, not Qt Project. See "this thread":http://stackoverflow.com/questions/559483/cstring-to-char for some clues.

          (Z(:^

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MarianMMX
            wrote on last edited by
            #5

            (If the project compiles with Visual Studio, and you are using the same compiler with QtCreator..)
            Probably you are missing some preprocessor definitions.
            http://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx

            In Visual Studio, project preperties, compiler section, command line, look for /D defines. (ex. /D_UNICODE /D_WIN32 /DCUSTOM_DEFINE)
            Add the missing ones to qmake project with DEFINES.
            @DEFINES += CUSTOM_DEFINE@

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved