Migrating from MFC to Qt: How to install qtwinmigrate
-
Could anybody explain to me how to install and/or build the qtwinmigrate? I don't understand the documentation: https://github.com/qtproject/qt-solutions/tree/master/qtwinmigrate
I'm trying to follow this talk here https://www.youtube.com/watch?v=-q7KAVEW45U but they did not explain the qtwinmigrate part painlessly at all.
I'm working in a MFC application very similar to the one in the video, and learning to migrate it to Qt5.
-
qtwinmigrate is deprecated, and you might not even need it.
I'm working in a MFC application very similar to the one in the video, and learning to migrate it to Qt5.
May I ask why you're using Qt 5 instead of Qt 6?
Recent versions of Qt can simply use the existing MFC event loop. You could simply add the following lines to your existing MFC project (and link to the Qt libraries):
int argc = 0; auto qtapp = new QApplication(argc, nullptr); auto widget = new QWidget; widget->show();
-
Hi and welcome to devnet,
Did you setup the widgets module properly ?
-
I created a new MFC project. As soon as I convert it to a QT project and add 1 widget class. It can not compile anymore.
#include <QtWidget> can not be resolved.
Any thoughts?@woldie said in Migrating from MFC to Qt: How to install qtwinmigrate:
#include <QtWidget> can not be resolved.
When you add a 3rd-party library to your project (not just Qt), you must add the appropriate Include Directories and Library Directories (see https://learn.microsoft.com/en-us/cpp/build/working-with-project-properties?view=msvc-170#directory-and-path-values )
The Qt VS Tools (https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022 ) might make it easier to set up the directories, although I don't know how that interacts with an MFC project.
-
After I deleted QWidget.*** from my test project now I am getting linker error like this.
https://forum.qt.io/topic/137730/how-to-disable-linking-with-qt6entrypoint-in-qmake/6But I do not know how to prevent QT qmake with QT Tools to remove the QT entrypoint.
Do I have to add a qmake file to my project to set "CONFIG -= entrypoint"?