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. Qml or c++ or both
Forum Updated to NodeBB v4.3 + New Features

Qml or c++ or both

Scheduled Pinned Locked Moved QML and Qt Quick
9 Posts 6 Posters 8.8k Views 1 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.
  • niqtN Offline
    niqtN Offline
    niqt
    wrote on last edited by
    #1

    I use qt since 1997 (version 0.6 can not remember), now I'm studying QML, but I still have not clear ideas about it. What is the ideal use? Graphics with QML and logic with C + +? QML only for simple mobile application? Use C ++ only for performance? It 'can hope to Pugin QML for browsers?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hhartz
      wrote on last edited by
      #2

      It depends on your use-case. You could think of it as a presentation-layer for your App where the business logic is in C++ - or where high performance computation/graphics are written in C++. You can also use JavaScript for simple imperative code. QML can be used both for simple and complex applications - again it depends on your use-case. There is no QtDeclarative plugin for browser in Qt.

      --

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gregschlom
        wrote on last edited by
        #3

        We use QML with C++ to make a desktop app that looks and behave like those web 2.0 apps. It's very powerful. All the logic is done in C++, and all the graphics in QML.

        I think the ideal use for desktop apps is:

        1. You want a beautiful interface

        2. With lots of effects and animations

        3. That looks the same on all platforms

        4. And that doesn't use the native widgets.

        So anything that should look like a web app or an iPhone / iPad app qualifies pretty well.

        Look at Spotify, for example (http://spotify.com/). That's the kind of interface that is easier to achieve in QML than in pure C++.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          archerabi
          wrote on last edited by
          #4

          Its easier to get consistent looking UI for multiple screen sizes if you use layouts in C++ .

          But for fixed screen sizes i guess QML is really wonderful.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mario
            wrote on last edited by
            #5

            @gregschlom: Well, I think that some parts are harder to accomplish with QML, for example, treeviews/tableviews with headers. Can you do them in QML w/o to much hack (or is it possible at all)?

            But when it comes to doing delegates for listviews nothing beats QML :)

            Hmm, you could still have an hybrid QML/Widget app though with the best from both worlds.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DenisKormalev
              wrote on last edited by
              #6

              We are using C++ and Qml together. Only Qml will not provide a lot of functionality for you, but together with C++ it will give a lot of power.

              mario, I've treeview qml implementation with not a big hack, but it supports only trees with not too many children. If you can read russian you can read it in my blog (in my profile).

              1 Reply Last reply
              0
              • G Offline
                G Offline
                gregschlom
                wrote on last edited by
                #7

                @archerabi: I don't have a lot of experience with layouts, but I would say the anchoring system in QML is powerful enough to make it easy to deal with different screen sizes.

                @mario: haven't tried to make list views with headers, but we did re-implemented our own list view component as QML's default one wasn't suiting our needs. So the bottom line is that it's really easy to extend QML, and with a few (ok, maybe a hundred or so) lines of C++ code, you can get exactly what you want.

                But yes, it's not for any project. It's more suited for projects with a strong focus on fluid user interface.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mario
                  wrote on last edited by
                  #8

                  Denis, Looks good! I don't know Russian but I understand code and the screenshot :)

                  Do you have the code downloadable somewhere (I guess it's free to use)? I'm to lazy to copy&paste it from the webpage :)

                  gregschlom, I agree, it's very easy to extend and I love the way how you do UIs with QML. But sometime it's hard to go from Widget-based UIs with a large portfolio of components (like comboboxes with completion) to nearly start from scratch. I think I have to change my mindset when building UIs with QML :)

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DenisKormalev
                    wrote on last edited by
                    #9

                    mario, yeah, I've uploaded this example to our lug server and you can download it "here":http://dl.yarlug.org/devel/Qt/qmlTreeModel.tar.gz .

                    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