PDA

View Full Version : QQuickView or QQmlApplicationEngine or QQuickWidget



ustulation
18th January 2015, 13:16
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 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 (Qt 5.4 now) ?

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.