/usr/share/qt5/doc/qtqml/qqmlapplicationengine.html is in qtdeclarative5-doc-html 5.9.5-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qqmlapplicationengine.cpp -->
<title>QQmlApplicationEngine Class | Qt QML 5.9</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
// loading style sheet breaks anchors that were jumped to before
// so force jumping to anchor again
setTimeout(function() {
var anchor = location.hash;
// need to jump to different anchor first (e.g. none)
location.hash = "#";
setTimeout(function() {
location.hash = anchor;
}, 0);
}, 0);
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td >Qt 5.9</td><td ><a href="qtqml-index.html">Qt QML</a></td><td ><a href="qtqml-module.html">C++ Classes</a></td><td >QQmlApplicationEngine</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.5 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QQmlApplicationEngine Class</h1>
<!-- $$$QQmlApplicationEngine-brief -->
<p><a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> provides a convenient way to load an application from a single QML file. <a href="#details">More...</a></p>
<!-- @@@QQmlApplicationEngine -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QQmlApplicationEngine></span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += qml</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.1</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qqmlengine.html">QQmlEngine</a></td></tr></table></div><ul>
<li><a href="qqmlapplicationengine-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#QQmlApplicationEngine">QQmlApplicationEngine</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#QQmlApplicationEngine-1">QQmlApplicationEngine</a></b>(const QUrl &<i>url</i>, QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#QQmlApplicationEngine-2">QQmlApplicationEngine</a></b>(const QString &<i>filePath</i>, QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#dtor.QQmlApplicationEngine">~QQmlApplicationEngine</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<QObject *> </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#rootObjects">rootObjects</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">25 public functions inherited from <a href="qqmlengine.html#public-functions">QQmlEngine</a></li>
<li class="fn">11 public functions inherited from <a href="qjsengine.html#public-functions">QJSEngine</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#load">load</a></b>(const QUrl &<i>url</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#load-1">load</a></b>(const QString &<i>filePath</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#loadData">loadData</a></b>(const QByteArray &<i>data</i>, const QUrl &<i>url</i> = QUrl())</td></tr>
</table></div>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qqmlapplicationengine.html#objectCreated">objectCreated</a></b>(QObject *<i>object</i>, const QUrl &<i>url</i>)</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="qqmlengine.html#signals">QQmlEngine</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qqmlengine.html#properties">QQmlEngine</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="qqmlengine.html#static-public-members">QQmlEngine</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qqmlengine.html#protected-functions">QQmlEngine</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QQmlApplicationEngine-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p><a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> provides a convenient way to load an application from a single QML file.</p>
<p>This class combines a <a href="qqmlengine.html">QQmlEngine</a> and <a href="qqmlcomponent.html">QQmlComponent</a> 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++.</p>
<p>It can be used like so:</p>
<pre class="cpp">
<span class="preprocessor">#include <QGuiApplication></span>
<span class="preprocessor">#include <QQmlApplicationEngine></span>
<span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
{
<span class="type"><a href="../qtgui/qguiapplication.html">QGuiApplication</a></span> app(argc<span class="operator">,</span> argv);
<span class="type"><a href="qqmlapplicationengine.html#QQmlApplicationEngine">QQmlApplicationEngine</a></span> engine(<span class="string">"main.qml"</span>);
<span class="keyword">return</span> app<span class="operator">.</span>exec();
}
</pre>
<p>Unlike QQuickView, <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> does not automatically create a root window. If you are using visual items from Qt Quick, you will need to place them inside of a Window.</p>
<p>You can also use <a href="../qtcore/qcoreapplication.html">QCoreApplication</a> with <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a>, if you are not using any QML modules which require a <a href="../qtgui/qguiapplication.html">QGuiApplication</a> (such as <code>QtQuick</code>).</p>
<p>List of configuration changes from a default <a href="qqmlengine.html">QQmlEngine</a>:</p>
<ul>
<li>Connecting Qt.<a href="qqmlengine.html#quit">quit</a>() to <a href="../qtcore/qcoreapplication.html#quit">QCoreApplication::quit</a>()</li>
<li>Automatically loads translation files from an i18n directory adjacent to the main QML file.</li>
<li>Automatically sets an incubation controller if the scene contains a QQuickWindow.</li>
<li>Automatically sets a <code>QQmlFileSelector</code> as the url interceptor, applying file selectors to all QML files and assets.</li>
</ul>
<p>The engine behavior can be further tweaked by using the inherited methods from <a href="qqmlengine.html">QQmlEngine</a>.</p>
</div>
<!-- @@@QQmlApplicationEngine -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QQmlApplicationEngine[overload1]$$$QQmlApplicationEngineQObject* -->
<h3 class="fn" id="QQmlApplicationEngine"><a name="QQmlApplicationEngine"></a>QQmlApplicationEngine::<span class="name">QQmlApplicationEngine</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Create a new <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> with the given <i>parent</i>. You will have to call <a href="qqmlapplicationengine.html#load">load</a>() later in order to load a QML file.</p>
<!-- @@@QQmlApplicationEngine -->
<!-- $$$QQmlApplicationEngine$$$QQmlApplicationEngineconstQUrl&QObject* -->
<h3 class="fn" id="QQmlApplicationEngine-1"><a name="QQmlApplicationEngine-1"></a>QQmlApplicationEngine::<span class="name">QQmlApplicationEngine</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &<i>url</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Create a new <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> and loads the QML file at the given <i>url</i>. This is provided as a convenience, and is the same as using the empty constructor and calling load afterwards.</p>
<!-- @@@QQmlApplicationEngine -->
<!-- $$$QQmlApplicationEngine$$$QQmlApplicationEngineconstQString&QObject* -->
<h3 class="fn" id="QQmlApplicationEngine-2"><a name="QQmlApplicationEngine-2"></a>QQmlApplicationEngine::<span class="name">QQmlApplicationEngine</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>filePath</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Create a new <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> and loads the QML file at the given <i>filePath</i>, which must be a local file path. If a relative path is given then it will be interpreted as relative to the working directory of the application.</p>
<p>This is provided as a convenience, and is the same as using the empty constructor and calling load afterwards.</p>
<!-- @@@QQmlApplicationEngine -->
<!-- $$$~QQmlApplicationEngine[overload1]$$$~QQmlApplicationEngine -->
<h3 class="fn" id="dtor.QQmlApplicationEngine"><a name="dtor.QQmlApplicationEngine"></a>QQmlApplicationEngine::<span class="name">~QQmlApplicationEngine</span>()</h3>
<p>Destroys the <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a> and all QML objects it loaded.</p>
<!-- @@@~QQmlApplicationEngine -->
<!-- $$$load[overload1]$$$loadconstQUrl& -->
<h3 class="fn" id="load"><a name="load"></a><code>[slot] </code><span class="type">void</span> QQmlApplicationEngine::<span class="name">load</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &<i>url</i>)</h3>
<p>Loads the root QML file located at <i>url</i>. The object tree defined by the file is created immediately for local file urls. Remote urls are loaded asynchronously, listen to the <a href="qqmlapplicationengine.html#objectCreated">objectCreated</a> signal to determine when the object tree is ready.</p>
<p>If an error occurs, error messages are printed with <a href="../qtcore/qtglobal.html#qWarning">qWarning</a>.</p>
<!-- @@@load -->
<!-- $$$load$$$loadconstQString& -->
<h3 class="fn" id="load-1"><a name="load-1"></a><code>[slot] </code><span class="type">void</span> QQmlApplicationEngine::<span class="name">load</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>filePath</i>)</h3>
<p>Loads the root QML file located at <i>filePath</i>. <i>filePath</i> must be a path to a local file. If <i>filePath</i> is a relative path, it is taken as relative to the application's working directory. The object tree defined by the file is instantiated immediately.</p>
<p>If an error occurs, error messages are printed with <a href="../qtcore/qtglobal.html#qWarning">qWarning</a>.</p>
<!-- @@@load -->
<!-- $$$loadData[overload1]$$$loadDataconstQByteArray&constQUrl& -->
<h3 class="fn" id="loadData"><a name="loadData"></a><code>[slot] </code><span class="type">void</span> QQmlApplicationEngine::<span class="name">loadData</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &<i>data</i>, const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &<i>url</i> = QUrl())</h3>
<p>Loads the QML given in <i>data</i>. The object tree defined by <i>data</i> is instantiated immediately.</p>
<p>If a <i>url</i> is specified it is used as the base url of the component. This affects relative paths within the data and error messages.</p>
<p>If an error occurs, error messages are printed with <a href="../qtcore/qtglobal.html#qWarning">qWarning</a>.</p>
<!-- @@@loadData -->
<!-- $$$objectCreated[overload1]$$$objectCreatedQObject*constQUrl& -->
<h3 class="fn" id="objectCreated"><a name="objectCreated"></a><code>[signal] </code><span class="type">void</span> QQmlApplicationEngine::<span class="name">objectCreated</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>object</i>, const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &<i>url</i>)</h3>
<p>This signal is emitted when an object finishes loading. If loading was successful, <i>object</i> contains a pointer to the loaded object, otherwise the pointer is NULL.</p>
<p>The <i>url</i> to the component the <i>object</i> came from is also provided.</p>
<p><b>Note: </b>If the path to the component was provided as a <a href="../qtcore/qstring.html">QString</a> containing a relative path, the <i>url</i> will contain a fully resolved path to the file.</p><!-- @@@objectCreated -->
<!-- $$$rootObjects[overload1]$$$rootObjects -->
<h3 class="fn" id="rootObjects"><a name="rootObjects"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span><<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *> QQmlApplicationEngine::<span class="name">rootObjects</span>() const</h3>
<p>Returns a list of all the root objects instantiated by the <a href="qqmlapplicationengine.html">QQmlApplicationEngine</a>. This will only contain objects loaded via <a href="qqmlapplicationengine.html#load">load</a>() or a convenience constructor.</p>
<p><b>Note: </b>In Qt versions prior to 5.9, this function is marked as non-<code>const</code>.</p><!-- @@@rootObjects -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|