Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt Widget vs. Qt Quick/QML ?
Forum Update on Monday, May 27th 2025

Qt Widget vs. Qt Quick/QML ?

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 29.9k 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
    aqtdummy
    wrote on 25 May 2014, 22:19 last edited by
    #1

    I am new to Qt and just went through these two tutorials:

    Getting Started Programming with Qt Widgets | QtDoc 5.3
    http://qt-project.org/doc/qt-5/gettingstartedqt.html

    Creating Qt Quick Projects | QtCreator
    http://qt-project.org/doc/qtcreator-3.1/quick-projects.html

    The Qt Widgets seem to have a more complete set of widgets like buttons etc., but the Qt Designer seems half baked, for example the field for the font size is unnecessarily wide and the up and down arrows for adjusting are way over on the right and tiny.

    On the other hand, the Qt Quick Designer looks much more polished but is lacking even the most basic button - in the tutorial a button is made out of a rectangle plus a mouse clicking area with multiple manual steps involved.

    I am mainly interested in Android and will need to define my own widgets, which one is better suited: Qt Quick or Qt Widgets?

    Thanks in advance!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JKSH
      Moderators
      wrote on 26 May 2014, 02:14 last edited by
      #2

      Hi,

      Since you are developing for Android, I recommend Qt Quick. Qt Quick was designed specifically with mobile touchscreen devices, and supports features that people expect from smartphones/tablets, like animated transitions and graphical effects. Widgets currently look horrible on Android.

      Also, QML (the language used to by Qt Quick) makes it very easy to write custom GUI components.

      However, if you were developing a traditional desktop office-style application, I would recommend Qt Widgets. It is more mature than Qt Quick and makes life easier for desktop app developers.

      [quote]On the other hand, the Qt Quick Designer looks much more polished but is lacking even the most basic button – in the tutorial a button is made out of a rectangle plus a mouse clicking area with multiple manual steps involved.[/quote]The tutorial is outdated. See "Qt Quick Controls":http://qt-project.org/doc/qt-5/qtquickcontrols-index.html for these basic components.

      I also think that tutorial is overly complex for "getting started" level. I recommend this "QML Tutorial":http://qt-project.org/doc/qt-5/qml-tutorial.html -- it's much easier to follow.

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aqtdummy
        wrote on 26 May 2014, 18:05 last edited by
        #3

        Thank you so much for the detailed explanation! I will give the tutorials a try.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aqtdummy
          wrote on 26 May 2014, 20:37 last edited by
          #4

          Actually one more question about QML: Is it some kind of interpreted (thus slow?) language? I had one occasion that some miss-placed brackets weren't caught by the compiler and caused error only at run time. The question is whether it performs as fast as native C++ code. I will have dozens of custom widgets, each will be doing hundreds of drawing operations per frame and the hope is to have at least 30 frames per second. (Each widget shows an X-Y plot of hundreds of data points that change with time.) Will QML be able to handle that?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Gianluca
            wrote on 26 May 2014, 21:10 last edited by
            #5

            QML is a scripting language.
            I didn't test how much is slow respect to the same thing done in pure C++ code.
            But, for what concerns your problem I think that QML can handle that otherwise Qt Digia would not offer the following products via QML:

            http://qt.digia.com/Product/Qt-Enterprise/Value-Add-Features/Charts/
            http://qt.digia.com/Product/Qt-Enterprise/Value-Add-Features/Advanced-Data-Visualization/

            So, the question is how QML can handle that :-) ... and I don't know.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aqtdummy
              wrote on 26 May 2014, 22:45 last edited by
              #6

              Thanks for the comment. Those look like static data charts, which are much less demanding than dynamic data charts updating at 30 fps.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JKSH
                Moderators
                wrote on 26 May 2014, 23:45 last edited by
                #7

                You're welcome :)

                [quote author="aqtdummy" date="1401136622"]Actually one more question about QML: Is it some kind of interpreted (thus slow?) language? I had one occasion that some miss-placed brackets weren't caught by the compiler and caused error only at run time. The question is whether it performs as fast as native C++ code. I will have dozens of custom widgets, each will be doing hundreds of drawing operations per frame and the hope is to have at least 30 frames per second. (Each widget shows an X-Y plot of hundreds of data points that change with time.) Will QML be able to handle that?[/quote]Why do you equate "interpreted" with "slow"? For example, "Julia":http://julialang.org/benchmarks/ is an interpreted language which is on par with C and Fortran, and blows Go (another compiled language) out of the water.

                Your code structure has a big influence, it's not just about interpreted vs. compiled.

                Anyway, yes QML is an interpreted language with a JIT compiler. Qt Quick items are rendered by the GPU, while Qt Widgets are rendered by the CPU. So generally, Qt Quick is faster than C++ widgets.

                For computationally-intensive rendering like what you've described, your caution is valid: pure QML might not handle it well. However, you can implement your code directly in C++/OpenGL via the "Qt Quick Scene Graph":http://qt-project.org/doc/qt-5/qtquick-visualcanvas-scenegraph.html. Here is an "example":http://qt-project.org/doc/qt-5/qtquick-scenegraph-openglunderqml-example.html.

                By the way, I recommend that you install the "Qt 5 Everywhere":https://play.google.com/store/apps/details?id=com.digia.Qt5Everywhere demo app on your Android device and try it out. It's written in pure QML but still features some impressive graphical effects (notably particles) Source code at https://qt.gitorious.org/qt-labs/qt5-everywhere-demo/source/QtDemo

                [quote author="Gianluca" date="1401138609"]QML is a scripting language.[/quote]It's more accurate to say that QML is a hybrid language that combines "Object Notation" with "Scripting". It has declarative and imperative parts.

                [quote author="aqtdummy" date="1401144303"]Thanks for the comment. Those look like static data charts, which are much less demanding than dynamic data charts updating at 30 fps.[/quote]Did you watch the video in the Advanced Data Visualization page that Gianluca linked? Focus on 2:20-2:40

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

                1 Reply Last reply
                1
                • A Offline
                  A Offline
                  aqtdummy
                  wrote on 30 May 2014, 01:18 last edited by
                  #8

                  Thank you so much again for taking the time to write such informative reply! I will go through the suggestions and come back later for more questions for sure. :)

                  1 Reply Last reply
                  0

                  1/8

                  25 May 2014, 22:19

                  • Login

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