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. Migrating from MFC to Qt: How to install qtwinmigrate
Forum Updated to NodeBB v4.3 + New Features

Migrating from MFC to Qt: How to install qtwinmigrate

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 576 Views 3 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.
  • Vil_JLV Offline
    Vil_JLV Offline
    Vil_JL
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      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();
      

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2
      • W Offline
        W Offline
        woldie
        wrote last edited by
        #3

        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?

        JKSHJ 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote last edited by
          #4

          Hi and welcome to devnet,

          Did you setup the widgets module properly ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • W woldie

            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?

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote last edited by
            #5

            @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.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            2
            • W Offline
              W Offline
              woldie
              wrote last edited by
              #6

              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/6

              But 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"?

              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