Details
-
Suggestion
-
Resolution: Done
-
P5: Not important
-
None
-
None
-
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
- duplicates
-
QTBUG-42347 qmlEngine function not available through QQmlEngine header
-
- Closed
-
For Gerrit Dashboard: QTBUG-50343 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
148313,4 | Include qqml.h in qqmlengine.h for convenience | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |