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

Make qqmlengine.h include qqml.h

    XMLWordPrintable

Details

    • 3024534574967ace249cf14f08d161ce4e728ba3

    Description

      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).

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes