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. How to convert Qt code in to C#(.Net).
Forum Updated to NodeBB v4.3 + New Features

How to convert Qt code in to C#(.Net).

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 3.3k Views
  • 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.
  • P Offline
    P Offline
    prabhat
    wrote on last edited by
    #1

    How to convert Qt code in to C#(.Net). I want to move the GUI part of my project from QT to some other language but want to call C++ method & function from GUI part.Please suggest the better way.

    jsulmJ 1 Reply Last reply
    0
    • P prabhat

      How to convert Qt code in to C#(.Net). I want to move the GUI part of my project from QT to some other language but want to call C++ method & function from GUI part.Please suggest the better way.

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

      @prabhat If you don't want to use Qt for your GUI you will need to rewrite your GUI. I don't think there is an easy way to convert C++ code which uses Qt into C# using WPF (I assume here you want to use WPF in C#?).

      But you actually could simply use C++ in .Net with Qt as Qt supports that combination.

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

      1 Reply Last reply
      4
      • P Offline
        P Offline
        prabhat
        wrote on last edited by
        #3

        @jsulm thank you so much for your reply. Could you suggest C# or UWP which will be better and how i can call third party application written in c++ using c#.

        jsulmJ 1 Reply Last reply
        0
        • P prabhat

          @jsulm thank you so much for your reply. Could you suggest C# or UWP which will be better and how i can call third party application written in c++ using c#.

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

          @prabhat said in How to convert Qt code in to C#(.Net).:

          C# or UWP which will be better

          These are two different things:
          C# is a programming language
          UWP (Universal Windows Platform) is an environment for applications.
          So, not sure what you're asking.

          "and how i can call third party application written in c++ using c#" - this is unclear. Do you start an application written in C++ in C# (this is possible)? Or do you want to use C++ code in your C# application? And again: you can use C++ to write Qt apps for UWP.

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

          1 Reply Last reply
          4
          • P Offline
            P Offline
            prabhat
            wrote on last edited by
            #5

            @jsulm due to GPL license issue i do not want to use Qt. I have one projcet that is developed in c++ and UI part is in QT. Now I just want to replace QT (UI) part with C# but C++ functionality will remain same.

            JonBJ VRoninV jsulmJ 3 Replies Last reply
            0
            • P prabhat

              @jsulm due to GPL license issue i do not want to use Qt. I have one projcet that is developed in c++ and UI part is in QT. Now I just want to replace QT (UI) part with C# but C++ functionality will remain same.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @prabhat
              Don't know what you mean. Nearly all of Qt (all that you should typically be using) is LGPL rather than GPL license. I can't believe that whether you write your code in C++ or C# will make any difference to licensing requirements, why do you think it would? You won't be able to convert the whole of the Qt code base from C++ to C#, and even if you did I don't think that would obviate licensing requirements, you can't take source code with a license and then hand-translate it to a new language and expect thereby to be excused from licensing considerations.

              BTW, https://github.com/ddobrev/QtSharp is still the most supported attempt to do Qt from C#. Have you looked at it (I have no idea how good it is or is not)? It should not remove licensing requirements.

              1 Reply Last reply
              4
              • P prabhat

                @jsulm due to GPL license issue i do not want to use Qt. I have one projcet that is developed in c++ and UI part is in QT. Now I just want to replace QT (UI) part with C# but C++ functionality will remain same.

                VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #7

                @prabhat said in How to convert Qt code in to C#(.Net).:

                due to GPL license

                Qt comes in many different licenses LGPL is probably the most popular and it's not much of a restriction if you ask me

                I just want to replace QT (UI) part with C#

                It's probably easier to just use C++/CLI. it links to the exact same libraries as C# but it remains C++ and allows you to mix managed and unmanaged code in the same project without going crazy

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                4
                • P prabhat

                  @jsulm due to GPL license issue i do not want to use Qt. I have one projcet that is developed in c++ and UI part is in QT. Now I just want to replace QT (UI) part with C# but C++ functionality will remain same.

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

                  @prabhat As I said: you can use C++ with .Net/WPF. And you can't replace Qt with C# as C# is a programming language and Qt a framework. What you probably mean is that you want to replace Qt with WPF, but there is no need to switch to C# for that.

                  And as others said: most of Qt is LGPL not GPL. And LGPL is not so restrictive and usually OK for commercial/closed source software.

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

                  1 Reply Last reply
                  5

                  • Login

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