1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the documentation of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
26 ****************************************************************************/
28 \page qtqml-cppclasses-engine.html
29 \title Qt QML Module C++ Classes - QQmlEngine
30 \brief Description of QQmlEngine
33 The QML engine runs and executes QML
34 applications. The engine loads, instantiates, and executes the QML context as
35 specified in QML files, plugins, or applications.
38 A QQmlEngine allows the configuration of global settings that
39 apply to all of its QML component instances: for example, the
40 QNetworkAccessManager to be used for network communications, and the
41 file path to be used for persistent storage.
43 QQmlComponent is used to load QML documents. Each
44 QQmlComponent instance represents a single document. A component
45 can be created from the URL or file path of a QML document, or the raw
46 QML code of the document. Component instances are instatiated through
47 the QQmlComponent::create() method, like this:
51 QQmlComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
52 QObject *rectangleInstance = component.create();
55 delete rectangleInstance;
58 QML documents can also be loaded using QQuickView.