Qt Project in Visual Studio 2022
-
wrote on 6 Nov 2023, 14:08 last edited by
I want to move my project written in qt to visual studio. Could you please inform me? Thank you.
-
@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.
wrote on 20 Nov 2023, 14:34 last edited by@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.
-
I want to move my project written in qt to visual studio. Could you please inform me? Thank you.
-
I want to move my project written in qt to visual studio. Could you please inform me? Thank you.
@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 -
wrote on 7 Nov 2023, 08:19 last edited by
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. -
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.wrote on 7 Nov 2023, 09:27 last edited by@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
-
@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-2022wrote on 9 Nov 2023, 10:47 last edited by@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.
-
@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.
@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. -
wrote on 10 Nov 2023, 07:20 last edited by
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.
-
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.
wrote on 14 Nov 2023, 06:38 last edited by@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?
-
@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?
@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. -
@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.wrote on 14 Nov 2023, 14:09 last edited by@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.
-
@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.
@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.
-
@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.
wrote on 20 Nov 2023, 14:34 last edited by@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.
-
-