Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-50343

Make qqmlengine.h include qqml.h

XMLWordPrintable

    • 3024534574967ace249cf14f08d161ce4e728ba3

      When a user creates a Qt Quick Application Project in Creator, they get this 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();
      }
      

      If they then want to register a C++ type for use in QML, they need to add a separate include:

      http://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterType

      If the most common (or perhaps only) use case for that function is related to QQmlEngine, then it makes sense for qqmlengine.h to include qqml.h (not QtQml, which is for the whole module).

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes