Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Are Qt/QML apps native or hybrid
Qt 6.12 LTS is out! See what's new in the release blog

Are Qt/QML apps native or hybrid

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 3.7k Views 2 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by mrjj
    #2

    Hi
    1: Often hybrid is used about applications that mix native code with web tech and runs
    in a browser. QML is cross-compiled to the target and is in that regards native.
    So QML is not hybrid in that sense. Using https://www.qt.io/qt-examples-for-webassembly
    would be such hybrid.

    2: Performance wise, Qt would not hinder to make the next block buster app.
    However, not all mobile concepts have a Qt wrapper so sometimes you must use native code/calls
    anyway.

    3: QML is made with c++. it uses javascript for interface logic and small tasks but for anything heavy
    you are recommended to make that in c++ and interface with the frontend.
    Its all compiled to the target so its really not hybrid or suffer any penalty
    to efficiency, stability and speed.

    4: They extend and refine QML to support new features and new platforms.

    Q 1 Reply Last reply
    7
    • mrjjM mrjj

      Hi
      1: Often hybrid is used about applications that mix native code with web tech and runs
      in a browser. QML is cross-compiled to the target and is in that regards native.
      So QML is not hybrid in that sense. Using https://www.qt.io/qt-examples-for-webassembly
      would be such hybrid.

      2: Performance wise, Qt would not hinder to make the next block buster app.
      However, not all mobile concepts have a Qt wrapper so sometimes you must use native code/calls
      anyway.

      3: QML is made with c++. it uses javascript for interface logic and small tasks but for anything heavy
      you are recommended to make that in c++ and interface with the frontend.
      Its all compiled to the target so its really not hybrid or suffer any penalty
      to efficiency, stability and speed.

      4: They extend and refine QML to support new features and new platforms.

      Q Offline
      Q Offline
      qcoderpro
      wrote on last edited by
      #3

      @mrjj

      Thank you so much for the answer.

      1- What does "cross-compiled to the target" in QML mean, please?
      2- I couldn't understand this section. Would you paraphrase it, please?
      3- So we must create the design part in QML and all the major code doing the real task in .cpp files. Was it what you meant? And when you say "compiled to the target" does it mean it's the behavior of native apps and not web based apps?

      aha_1980A 1 Reply Last reply
      0
      • Q qcoderpro

        @mrjj

        Thank you so much for the answer.

        1- What does "cross-compiled to the target" in QML mean, please?
        2- I couldn't understand this section. Would you paraphrase it, please?
        3- So we must create the design part in QML and all the major code doing the real task in .cpp files. Was it what you meant? And when you say "compiled to the target" does it mean it's the behavior of native apps and not web based apps?

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @qcoderpro

        And when you say "compiled to the target" does it mean it's the behavior of native apps and not web based apps?

        Sure, C++ is a compiled language that results in native machine code - unlike Java which is compiled to machine independent code.

        Note that there is also a QtQuick compiler. I have not used that myself so I cannot say much about it.

        Regards

        Qt has to stay free or it will die.

        Q 1 Reply Last reply
        2
        • aha_1980A aha_1980

          @qcoderpro

          And when you say "compiled to the target" does it mean it's the behavior of native apps and not web based apps?

          Sure, C++ is a compiled language that results in native machine code - unlike Java which is compiled to machine independent code.

          Note that there is also a QtQuick compiler. I have not used that myself so I cannot say much about it.

          Regards

          Q Offline
          Q Offline
          qcoderpro
          wrote on last edited by
          #5

          @aha_1980
          Thank you.
          Does your first sentence mean that, in some cases creating an Android app using C++ may be better than the one created by Java, because of their different methods of compilation? If so, in what context is it better? I guess "speed".

          For the QtQuick compiler, I hope another expert here gives some clear explanation.

          aha_1980A 1 Reply Last reply
          0
          • Q qcoderpro

            @aha_1980
            Thank you.
            Does your first sentence mean that, in some cases creating an Android app using C++ may be better than the one created by Java, because of their different methods of compilation? If so, in what context is it better? I guess "speed".

            For the QtQuick compiler, I hope another expert here gives some clear explanation.

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by aha_1980
            #6

            @qcoderpro I would not say that C++ is faster than Java, nor vice versa. Both can produce very fast, but also very slow programs if you use them wrong.

            Java has the Just-in-Time compiler to optimize at run time, which can gain performance for some programs. On the other hand, it has the Garbage Collector which can make your app slow if it starts to clean up at the wrong moment. I'd take that as a small advantage for C++ ;)

            Qt has to stay free or it will die.

            Q 1 Reply Last reply
            3
            • aha_1980A aha_1980

              @qcoderpro I would not say that C++ is faster than Java, nor vice versa. Both can produce very fast, but also very slow programs if you use them wrong.

              Java has the Just-in-Time compiler to optimize at run time, which can gain performance for some programs. On the other hand, it has the Garbage Collector which can make your app slow if it starts to clean up at the wrong moment. I'd take that as a small advantage for C++ ;)

              Q Offline
              Q Offline
              qcoderpro
              wrote on last edited by
              #7

              @aha_1980
              Thank you very much.
              Now all it remains is the questions I asked to reply to @mrjj

              1 Reply Last reply
              0
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #8

                Hi
                1- What does "cross-compiled to the target" in QML mean, please?

                (*)it means that the Qt you are using is made for the target/platform/architecture. When you, as example, make an app for Andriod, both Qt/QML(system) and your code is compiled with a compiler that can generate code for the given platform.

                2- I couldn't understand this section. Would you paraphrase it, please?

                (*)Qt/QML is as fast as any other native application.
                However, Not all mobile features is wrapped by Qt so most apps will mix
                both Qt/QML and some native calls.

                3- So we must create the design part in QML and all the major code doing the real task in .cpp files. Was it what you meant? And when you say "compiled to the target" does it mean it's the behavior of native apps and not web based apps?
                (*) Yes
                Both because not all can be done with the javascript but also
                due to it was designed this way. Using QML as front end and a c++
                backend for maximum UX flexibility and max performance.

                Q 1 Reply Last reply
                5
                • mrjjM mrjj

                  Hi
                  1- What does "cross-compiled to the target" in QML mean, please?

                  (*)it means that the Qt you are using is made for the target/platform/architecture. When you, as example, make an app for Andriod, both Qt/QML(system) and your code is compiled with a compiler that can generate code for the given platform.

                  2- I couldn't understand this section. Would you paraphrase it, please?

                  (*)Qt/QML is as fast as any other native application.
                  However, Not all mobile features is wrapped by Qt so most apps will mix
                  both Qt/QML and some native calls.

                  3- So we must create the design part in QML and all the major code doing the real task in .cpp files. Was it what you meant? And when you say "compiled to the target" does it mean it's the behavior of native apps and not web based apps?
                  (*) Yes
                  Both because not all can be done with the javascript but also
                  due to it was designed this way. Using QML as front end and a c++
                  backend for maximum UX flexibility and max performance.

                  Q Offline
                  Q Offline
                  qcoderpro
                  wrote on last edited by
                  #9

                  @mrjj

                  Thank you very much. I think I got all the things I wanted to.
                  you also encouraged me and made me confident to continue with Qt. Thanks. :)

                  mrjjM 1 Reply Last reply
                  3
                  • Q qcoderpro

                    @mrjj

                    Thank you very much. I think I got all the things I wanted to.
                    you also encouraged me and made me confident to continue with Qt. Thanks. :)

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @qcoderpro
                    Super. Happy programming.
                    Btw. just in case you didnt notice before
                    https://qmlbook.github.io/

                    Q 1 Reply Last reply
                    4
                    • mrjjM mrjj

                      @qcoderpro
                      Super. Happy programming.
                      Btw. just in case you didnt notice before
                      https://qmlbook.github.io/

                      Q Offline
                      Q Offline
                      qcoderpro
                      wrote on last edited by
                      #11

                      @mrjj
                      Thanks. :)

                      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
                      • Unsolved