Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Udp and Tcp sockets with QML
QtWS25 Last Chance

Udp and Tcp sockets with QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 6.7k 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.
  • A Offline
    A Offline
    Ankit.Jain
    wrote on last edited by
    #1

    Hi,
    I recently got a requirement/suggestion for moving a QT C/C++ GUI to QML GUI. I found that the application uses TCP and UDP sockets. I also realized that QML does not provide a direct UDP/TCP class.
    I found a couple of ways to do it:

    1. Integrate QML code into QT code. [http://doc.qt.io/qt-5/qtqml-cppintegration-topic.html]
    2. Use a user built QML code [which does the same thing as above but its a qml class] [https://github.com/jemc/qml-sockets]

    I want to know the best way to do it. Any help would be appreciated.
    Thanks.

    1 Reply Last reply
    1
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Basically whichever is easier for you to do. Normally, people focus on doing GUI in QML and keeping business logic in C++ - this has 2 major benefits:

      • deep separation between UI and logic, which helps later in e. g. changing UIs, styling, different UIs for mobile and desktop apps etc.
      • C++ does what it is best at (performance, interfacing with databases, other libraries etc.), and QML does what it's best at (beautiful and fluid GUIs)

      Since you already have the app written in Qt C++, I'd say it will be more convenient for you to only rewrite the GUI parts in QML, and leave the current code for the rest. However, if the current code is of poor quality, you may consider rewriting the whole thing. Hard to say.

      (Z(:^

      A 1 Reply Last reply
      5
      • sierdzioS sierdzio

        Basically whichever is easier for you to do. Normally, people focus on doing GUI in QML and keeping business logic in C++ - this has 2 major benefits:

        • deep separation between UI and logic, which helps later in e. g. changing UIs, styling, different UIs for mobile and desktop apps etc.
        • C++ does what it is best at (performance, interfacing with databases, other libraries etc.), and QML does what it's best at (beautiful and fluid GUIs)

        Since you already have the app written in Qt C++, I'd say it will be more convenient for you to only rewrite the GUI parts in QML, and leave the current code for the rest. However, if the current code is of poor quality, you may consider rewriting the whole thing. Hard to say.

        A Offline
        A Offline
        Ankit.Jain
        wrote on last edited by
        #3

        @sierdzio
        Thanks for the answer. I can't find the way to mark this thread as solved though. Thanks again.

        sierdzioS 1 Reply Last reply
        0
        • A Ankit.Jain

          @sierdzio
          Thanks for the answer. I can't find the way to mark this thread as solved though. Thanks again.

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @Ankit.Jain said in Udp and Tcp sockets with QML:

          @sierdzio
          Thanks for the answer. I can't find the way to mark this thread as solved though. Thanks again.

          Done. It's under the "Topic tools" menu.

          I'm glad it helped, happy coding!

          (Z(:^

          1 Reply Last reply
          1

          • Login

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