Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Difference between QQmlApplicationEngine and QtQuick2ApplicationViewer

    QML and Qt Quick
    2
    2
    1789
    Loading More Posts
    • 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.
    • D
      DerMas last edited by

      I started developing my app with Qt 5.1. So I created a new QtQuick Application with the QtCreator wizard. The Application is started with the following code in main.cpp:

      @#include <QtGui/QGuiApplication>
      #include "qtquick2applicationviewer.h"

      int main(int argc, char *argv[])
      {
      QGuiApplication app(argc, argv);

      QtQuick2ApplicationViewer viewer;
      viewer.setMainQmlFile&#40;QStringLiteral("qml/MyApp/main.qml"&#41;&#41;;
      viewer.showExpanded();
      
      return app.exec&#40;&#41;;
      

      }@

      Now with Qt 5.3 I created a new QtQuick Application with the QtCreator wizard and the startup process has changed in main.cpp:

      @#include <QGuiApplication>
      #include <QQmlApplicationEngine>

      int main(int argc, char *argv[])
      {
      QGuiApplication app(argc, argv);

      QQmlApplicationEngine engine;
      engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
      
      return app.exec&#40;&#41;;
      

      }
      @

      Are there any important differences between the startup strategies, like performance impacts? My Application runs on Android, if that matters.

      1 Reply Last reply Reply Quote 0
      • V
        Vincent007 last edited by

        You can run QML profiler to test the speed.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post