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. Qt Project in Visual Studio 2022
Forum Updated to NodeBB v4.3 + New Features

Qt Project in Visual Studio 2022

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 7.1k 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.
  • F Offline
    F Offline
    Furkan
    wrote on last edited by
    #1

    I want to move my project written in qt to visual studio. Could you please inform me? Thank you.

    S jsulmJ 2 Replies Last reply
    0
    • jsulmJ jsulm

      @Furkan said in Qt Project in Visual Studio 2022:

      it can only be done by introducing the pro file to visual studi

      More future proof would be to switch from QMake to CMake. Because Qt6 uses CMake by default and Visual Studio supports CMake directly.

      F Offline
      F Offline
      Furkan
      wrote on last edited by
      #13

      @jsulm I have solved this problem. Firstly, I use Qt vs tools to import my project but I have taken another error. It says "msvc-version.conf loaded but QMAKE_MSC_VER isn't set". Than I open msvc_version.conf file in wordpad to give a version. In this file, it says which version you should use for your visual studio version. I have done this to. After that, I just add my lib files and other environments.

      1 Reply Last reply
      0
      • F Furkan

        I want to move my project written in qt to visual studio. Could you please inform me? Thank you.

        S Offline
        S Offline
        SamiV123
        wrote on last edited by
        #2

        @Furkan

        1. Move from qmake to cmake
        2. Use cmake to generate your project build (visual studio solution)
        1 Reply Last reply
        0
        • F Furkan

          I want to move my project written in qt to visual studio. Could you please inform me? Thank you.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #3

          @Furkan said in Qt Project in Visual Studio 2022:

          I want to move my project written in qt to visual studio

          What do you mean exactly?
          You want to use Qt in Visual Studio?
          If so then see https://doc.qt.io/qtvstools/index.html and https://www.qt.io/blog/qt-vs-tools-for-visual-studio-2022

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          F 1 Reply Last reply
          0
          • S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #4

            I highly dislike the Qt plugin for Visual Studio. For QMake-based project I just run qmake -tp vc myproject.pro on the command line which yields a much better VS project (dependencies are better resolved). CMake is a lot easier because you can just open it in either VS or QtCreator.

            S 1 Reply Last reply
            0
            • S SimonSchroeder

              I highly dislike the Qt plugin for Visual Studio. For QMake-based project I just run qmake -tp vc myproject.pro on the command line which yields a much better VS project (dependencies are better resolved). CMake is a lot easier because you can just open it in either VS or QtCreator.

              S Offline
              S Offline
              SamiV123
              wrote on last edited by
              #5

              @SimonSchroeder said in Qt Project in Visual Studio 2022:

              I highly dislike the Qt plugin for Visual Studio. For QMake-based project I just run qmake -tp vc myproject.pro on the command line which yields a much better VS project (dependencies are better resolved). CMake is a lot easier because you can just open it in either VS or QtCreator.

              Also in Clion

              1 Reply Last reply
              0
              • jsulmJ jsulm

                @Furkan said in Qt Project in Visual Studio 2022:

                I want to move my project written in qt to visual studio

                What do you mean exactly?
                You want to use Qt in Visual Studio?
                If so then see https://doc.qt.io/qtvstools/index.html and https://www.qt.io/blog/qt-vs-tools-for-visual-studio-2022

                F Offline
                F Offline
                Furkan
                wrote on last edited by
                #6

                @jsulm I have done my project in qt by using qml and c++. My customer said they wanted the project in Visual Studio. Because of that I want to change my compiler from Qt to Visual Studio, I want to do this using only the pro file.

                jsulmJ 1 Reply Last reply
                0
                • F Furkan

                  @jsulm I have done my project in qt by using qml and c++. My customer said they wanted the project in Visual Studio. Because of that I want to change my compiler from Qt to Visual Studio, I want to do this using only the pro file.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  @Furkan said in Qt Project in Visual Studio 2022:

                  I want to change my compiler from Qt to Visual Studio

                  Qt is not a compiler.
                  You can use Qt in Visual Studio just fine as pointed out in this thread.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    SimonSchroeder
                    wrote on last edited by
                    #8

                    Qt does not come with its own compiler. It uses the one you install yourself. If you only have Visual Studio installed, you're good to go. During installation you have to pick the precompiled version of Qt for a specific compiler, either MSVC or mingw. It is not possible to switch the compiler for the same compiled Qt library.

                    Within QtCreator you can select different "Kits". A kit consists of a compiled Qt library with Qt tools and a compiler. If you want to change the compiler, select a different kit. Sometimes you have to create your own kits. It would be different, though, when your compiling from the command line.

                    F 1 Reply Last reply
                    1
                    • S SimonSchroeder

                      Qt does not come with its own compiler. It uses the one you install yourself. If you only have Visual Studio installed, you're good to go. During installation you have to pick the precompiled version of Qt for a specific compiler, either MSVC or mingw. It is not possible to switch the compiler for the same compiled Qt library.

                      Within QtCreator you can select different "Kits". A kit consists of a compiled Qt library with Qt tools and a compiler. If you want to change the compiler, select a different kit. Sometimes you have to create your own kits. It would be different, though, when your compiling from the command line.

                      F Offline
                      F Offline
                      Furkan
                      wrote on last edited by
                      #9

                      @SimonSchroeder I'm sorry for using the wrong term. My English is not well. By the way, I create my project with qt 6.6.0 mingw64 kit, but I can't transfer this project to visual studio. Also, I should change the language from Qml to C++. How can I do this?

                      jsulmJ 1 Reply Last reply
                      0
                      • F Furkan

                        @SimonSchroeder I'm sorry for using the wrong term. My English is not well. By the way, I create my project with qt 6.6.0 mingw64 kit, but I can't transfer this project to visual studio. Also, I should change the language from Qml to C++. How can I do this?

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        @Furkan said in Qt Project in Visual Studio 2022:

                        but I can't transfer this project to visual studio

                        Why? What is the problem?
                        " I should change the language from Qml to C++. How can I do this?" - you will need to rewrite what you're doing with QML to use QtWidgets instead of QML.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        F 1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @Furkan said in Qt Project in Visual Studio 2022:

                          but I can't transfer this project to visual studio

                          Why? What is the problem?
                          " I should change the language from Qml to C++. How can I do this?" - you will need to rewrite what you're doing with QML to use QtWidgets instead of QML.

                          F Offline
                          F Offline
                          Furkan
                          wrote on last edited by
                          #11

                          @jsulm You're right, I'll have to rewrite for that. I learned that in order to import from the qt environment to visual studio, it can only be done by introducing the pro file to visual studio. For this, I added qt vs tools to visual studio and I select the pro file with the help of these tools, but I cannot access the other .qml, .cpp and .h files in the pro file. The main.qml and main.cpp files created by visual studio are automatically created and when I run them, only these files work. I can explain my problem in detail this way. I apologize for explaining the problem less clearly before.

                          jsulmJ 1 Reply Last reply
                          0
                          • F Furkan

                            @jsulm You're right, I'll have to rewrite for that. I learned that in order to import from the qt environment to visual studio, it can only be done by introducing the pro file to visual studio. For this, I added qt vs tools to visual studio and I select the pro file with the help of these tools, but I cannot access the other .qml, .cpp and .h files in the pro file. The main.qml and main.cpp files created by visual studio are automatically created and when I run them, only these files work. I can explain my problem in detail this way. I apologize for explaining the problem less clearly before.

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #12

                            @Furkan said in Qt Project in Visual Studio 2022:

                            it can only be done by introducing the pro file to visual studi

                            More future proof would be to switch from QMake to CMake. Because Qt6 uses CMake by default and Visual Studio supports CMake directly.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            F 1 Reply Last reply
                            0
                            • jsulmJ jsulm

                              @Furkan said in Qt Project in Visual Studio 2022:

                              it can only be done by introducing the pro file to visual studi

                              More future proof would be to switch from QMake to CMake. Because Qt6 uses CMake by default and Visual Studio supports CMake directly.

                              F Offline
                              F Offline
                              Furkan
                              wrote on last edited by
                              #13

                              @jsulm I have solved this problem. Firstly, I use Qt vs tools to import my project but I have taken another error. It says "msvc-version.conf loaded but QMAKE_MSC_VER isn't set". Than I open msvc_version.conf file in wordpad to give a version. In this file, it says which version you should use for your visual studio version. I have done this to. After that, I just add my lib files and other environments.

                              1 Reply Last reply
                              0
                              • F Furkan has marked this topic as solved on
                              • E edvid referenced this topic on

                              • Login

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