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. Starting out with QML, looking to get some recommendations
Forum Updated to NodeBB v4.3 + New Features

Starting out with QML, looking to get some recommendations

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 2.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.
  • S Offline
    S Offline
    SavageTwinky
    wrote on last edited by
    #1

    So apparently there are two ways to use QML and c++ together, loading QML bits into C++, or loading C++ bits into a QML app.

    I'm wondering if there is any particular reason I might want to choose one over the other. I'm going to be writing an application that will have a couple of background threads that signal progress to a main window. I know I want my main window to be QML but I keep bouncing back in forth between using qmlRegisterType to load a c++ class into QML or use QmlDocument to load a qml view into c++ class.

    I'm having hard time finding good sources for examples, most of the examples I've found didn't show everything or something, and I had a hard time replicating it. I was hoping I could find QML series of videos like youtube's VoidRealm's Qt series, since thats the majority of where I learned how to program in Qt. Unfortuneatly I just found a dood tutorial of how to make a golden monkey head with dancing penguins! I feel spoiled.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      This is a difficult topic and it cannot really be answered without knowing more about the scope or type of your project. Here is a recent article about the role of C++ in QML that you might find interesting: http://alan.imagin-itis.net/?p=444

      • If you have a large chunk of existing widget code or you know you will be needing (currently) widget specific functionality such as Dock widgets, tree views, etc, you will anyway have to go for embedding QML. This is what Qt Creator does as it's main code base is based on widgets.

      • If you are writing a new UI in Qt Quick, I would lean towards registering types to QML. This will give you a clean distinction between front end and what have to go into the backend and will make it almost trivial to write a completely new UI on a new platform.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chrisadams
        wrote on last edited by
        #3

        Hi,

        Currently there aren't too many video resources, as far as I'm aware, but the documentation is fairly comprehensive:

        http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qtquick-applicationdevelopers.html
        http://doc-snapshot.qt-project.org/qt5-stable/qtqml/qtqml-index.html
        http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qtquick-index.html

        In particular, see http://doc-snapshot.qt-project.org/qt5-stable/qtqml/qtqml-cppintegration-topic.html for information about QML/C++ integration.

        Cheers,
        Chris.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SavageTwinky
          wrote on last edited by
          #4

          Excellent thanks, I think we started off with with pulling QML into qt widgets because it was easier, but we are separating the UI with our back end now, we might swap it for the distinction.

          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