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. Are Qt/QML apps native or hybrid
Forum Updated to NodeBB v4.3 + New Features

Are Qt/QML apps native or hybrid

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 2.0k 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.
  • Q Offline
    Q Offline
    qcoderpro
    wrote on last edited by qcoderpro
    #1

    Hello to all Qt people here,

    I'm programming in the world of Qt/QML and have come here just to know about the pros and cons of Qt/QML when they say they're cross-platform. I want to know, at what price.

    • I suppose when Qt/QML is cross platform, hence it's hybrid. But hybrid apps are said to essentially be 'websites', and they don’t work offline. But my Qt/QML apps can be run and work correctly even if my PC or mobile is not connected to the Internet. Eventually, is Qt/QML hybrid or native?

    • Among the cons of hybrid solutions are these that they can never deliver same efficiency, processing speed and stability as native codes. If it's right, so a QML or even Felgo programmer can never create a major and important Android app on Qt Creator to be as perfect as the one created by Java on Android Studio. Is this wrong? If not, and it's true, so if we want to create great mobile apps either for Android or iOS, using the world of Qt, it is but wasting time and we'd better go for Java and Swift.

    • Qt is merely based on C++ and it's its most significant point. QML is based on JavaScript (which is a hybrid language, hence a negative point for QML), C++ and OpenGL. I want to know how does QML use C++ and OpenGL to keep itself from being hybrid and take advantages of those two languages to be as close as possible to native code so that the apps created by it don't lack the features of efficiency, stability and speed?

    • The last question is that, what do the managers and experts of the Qt company do to address the matters above when they're strongly dealing with evolving and updating Qt gradually?

    Thanks so much for your time.

    1 Reply Last reply
    0
    • 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 Extensions
                        • Unsolved