QQuickView or QQmlApplicationEngine or QQuickWidget



  • I had completed several months back, a desktop project from scratch to its release taking more than one and half years, with Qt-c++/QML combination. Ofcourse I had no idea of QML/QtQuick before that and must say I learnt a lot. Now as my team looks to start another front end project from scratch, I realize that there are more ways then to start than I had previously known. The previous project used a custom QQuickView derivative. When multiple windows were required to show on different screens, I had to spawn or destroy multiple instances of that class and all was good. However now I notice there are more choices - QQmlApplicationEngine, QQuickWidget etc instead of QQuickView. For multiple windows, single QQmlApplicationEngine can be given different root qml files and each window can be accessed (after proper casting) via QQmlApplicationEngine::​rootObjects().value(<n>). Haven't read much into QQuickWidget specially after it said there is some performance hit using that.

    So can someone provide a nice guideline of when to use which approach and their advantages over the other ?

    For eg., In my QQuickView derivative I could easily handle the events by overriding the appropriate virtuals. Don't know if that would be possible/convenient for QQmlApplicationEngine approach, etc.


  • Moderators

    Hi,

    Start by reading "this thread":http://qt-project.org/forums/viewthread/49581

    Use QQuickWidget if (and only if) you want to integrate your QML GUI into a C++ QWidget-based GUI.

    Post back if you'd like anything clarified.

    [quote author="ustulation" date="1421583894"]For eg., In my QQuickView derivative I could easily handle the events by overriding the appropriate virtuals. Don't know if that would be possible/convenient for QQmlApplicationEngine approach, etc.[/quote]What kind of events do you mean?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.