diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-02-04 09:31:40 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-02-05 08:30:34 +0000 |
commit | 3024534574967ace249cf14f08d161ce4e728ba3 (patch) | |
tree | cf9bed8a7c71e7b99f31cd35441e871b56e01fa0 /src/qml/qml/qqmlengine.h | |
parent | 80eabc56349b5efe4acf3fcb467b5b2d6491131f (diff) |
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 <QtQml>" (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 <jpnurmi@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlengine.h')
-rw-r--r-- | src/qml/qml/qqmlengine.h | 1 |
1 files changed, 1 insertions, 0 deletions
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 <QtCore/qobject.h> #include <QtCore/qmap.h> #include <QtQml/qjsengine.h> +#include <QtQml/qqml.h> #include <QtQml/qqmlerror.h> #include <QtQml/qqmldebug.h> |