From 3024534574967ace249cf14f08d161ce4e728ba3 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 4 Feb 2016 09:31:40 +0100 Subject: Include qqml.h in qqmlengine.h for convenience When a user creates a Qt Quick Application Project in Creator, they get this main.cpp: int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); } According to the current documentation, if they then want to register a C++ type for use in QML, they need to add a separate "#include " (which is actually a module-wide include and brings a lot of unnecessary files with it). If the most common (or perhaps only) use case for that function (and all of the others declared in qqml.h but documented as requiring QtQml) is related to QQmlEngine, then it makes sense for qqmlengine.h to include qqml.h. This change makes it so that users can use these functions with no changes to the code that Creator provides, as QQmlApplicationEngine includes QQmlEngine. Change-Id: I9d6be2e1abfd4cc831ca04dab4c2a9e50021f748 Task-number: QTBUG-50343 Reviewed-by: J-P Nurmi Reviewed-by: Lars Knoll --- src/qml/qml/qqmlengine.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/qml/qqmlengine.h') diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h index eee0587531..a7eda0ee6c 100644 --- a/src/qml/qml/qqmlengine.h +++ b/src/qml/qml/qqmlengine.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3