209 \brief QQmlApplicationEngine provides a convenient way to load an application from a single QML file.
210
211 This class combines a QQmlEngine and QQmlComponent to provide a convenient way to load a single QML file. It also exposes some central application functionality to QML, which a C++/QML hybrid application would normally control from C++.
212
213 It can be used like so:
214
215 \code
216 #include <QGuiApplication>
217 #include <QQmlApplicationEngine>
218
219 int main(int argc, char *argv[])
220 {
221 QGuiApplication app(argc, argv);
222 QQmlApplicationEngine engine("main.qml");
223 return app.exec();
224 }
225 \endcode
226
227 \note Unlike QQuickView, QQmlApplicationEngine does not automatically create a
228 root window. If you are using visual items from Qt Quick, you will need to
229 place them inside a \l [QML] {Window}.
230
231 You can also use QCoreApplication with QQmlApplicationEngine, if you are not using any QML modules which require a QGuiApplication (such as \c QtQuick).
232
233 List of configuration changes from a default QQmlEngine:
234
235 \list
236 \li Connecting Qt.quit() to QCoreApplication::quit()
237 \li Automatically loads translation files from an i18n directory adjacent to the main QML file.
238 \li Translations are reloaded when the \c QJSEngine::uiLanguage / \c Qt.uiLanguage property is changed.
239 \li Automatically sets an incubation controller if the scene contains a QQuickWindow.
240 \li Automatically sets a \c QQmlFileSelector as the url interceptor, applying file selectors to all
241 QML files and assets.
242 \endlist
243
244 The engine behavior can be further tweaked by using the inherited methods from QQmlEngine.
245
246 \note Translation files must have a \e qml_ prefix in order to be recognized,
247 e.g. \e{qml_ja_JP.qm}.
248
249 \note Placing translation files relative to the main QML file involves adding
250 a \e RESOURCE_PREFIX to the relevant \l qt_add_translations call. This
251 needs to include the resource prefix of the main file's QML module
252 (\e{/qt/qml} by default) and the module URI. For example, to provide
253 translation files for a module called "Translated":