This file is indexed.

/usr/share/qt5/doc/qtqml/qtqml-documents-topic.html is in qtdeclarative5-doc-html 5.2.1-3ubuntu15.

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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- topic.qdoc -->
  <title>QML Documents | QtQml 5.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.2</li>
<li><a href="qtqml-index.html">Qt QML</a></li>
<li>QML Documents</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#structure-of-a-qml-document">Structure of a QML Document</a></li>
<li class="level2"><a href="#syntax-of-the-qml-language">Syntax of the QML Language</a></li>
<li class="level1"><a href="#defining-object-types-through-qml-documents">Defining Object Types through QML Documents</a></li>
<li class="level1"><a href="#resource-loading-and-network-transparency">Resource Loading and Network Transparency</a></li>
<li class="level1"><a href="#scope-and-naming-resolution">Scope and Naming Resolution</a></li>
</ul>
</div>
<h1 class="title">QML Documents</h1>
<span class="subtitle"></span>
<!-- $$$qtqml-documents-topic.html-description -->
<div class="descr"> <a name="details"></a>
<p>A QML document is a string which conforms to QML document syntax. A document defines a QML object type. A document is generally loaded from a <tt>&quot;.qml&quot;</tt> file stored either locally or remotely, but can be constructed manually in code. An instance of the object type defined by a document may be created using a <a href="qml-qtqml-component.html">Component</a> in QML code, or a <a href="qqmlcomponent.html">QQmlComponent</a> in C++. Alternatively, if the object type is explicitly exposed to the QML type system with a particular type name, the type may be used directly in object declarations in other documents.</p>
<p>The ability to define re-usable QML object types in documents is an important enabler to allow clients to write modular, highly readable and maintainable code.</p>
<a name="structure-of-a-qml-document"></a>
<h2>Structure of a QML Document</h2>
<p>A QML document consists of two sections: the imports section, and the object declaration section. The imports section in a document contains import statements that define which QML object types and JavaScript resources the document is able to use. The object declaration section defines the object tree to be created when instantiating the object type defined by the document.</p>
<p>An example of a simple document is as follows:</p>
<pre class="qml">import QtQuick 2.0

<span class="type">Rectangle</span> {
    <span class="name">width</span>: <span class="number">300</span>
    <span class="name">height</span>: <span class="number">200</span>
    <span class="name">color</span>: <span class="string">&quot;blue&quot;</span>
}</pre>
<p>See the <a href="qtqml-documents-structure.html">Structure of a QML Document</a> for more information on the topic.</p>
<a name="syntax-of-the-qml-language"></a>
<h3>Syntax of the QML Language</h3>
<p>The object declaration section of the document must specify a valid object hierarchy with appropriate <a href="qtqml-syntax-basics.html">QML syntax</a>. An object declaration may include the specification of custom <a href="qtqml-syntax-objectattributes.html">object attributes</a>. Object method attributes may be specified as JavaScript functions, and object property attributes may be assigned <a href="qtqml-syntax-propertybinding.html">property binding expressions</a>.</p>
<p>Please see the documentation about the <a href="qtqml-syntax-basics.html">syntax of QML</a> for more information about valid syntax, and see the documentation about <a href="qtqml-javascript-topic.html">integrating QML and JavaScript</a> for in-depth information on that topic.</p>
<a name="defining-object-types-through-qml-documents"></a>
<h2>Defining Object Types through QML Documents</h2>
<p>As described briefly in the previous section, a document implicitly defines a QML object type. One of the core principles of QML is the ability to define and then re-use object types. This improves the maintainability of QML code, increases the readability of object hierarchy declarations, and promotes separation between UI definition and logic implementation.</p>
<p>In the following example, the client developer defines a <tt>Button</tt> type with a document in a file:</p>
<pre class="qml"><span class="comment">// Button.qml</span>
import QtQuick 2.0

<span class="type">Rectangle</span> {
    <span class="name">width</span>: <span class="number">100</span>; <span class="name">height</span>: <span class="number">100</span>
    <span class="name">color</span>: <span class="string">&quot;red&quot;</span>

    <span class="type">MouseArea</span> {
        <span class="name">anchors</span>.fill: <span class="name">parent</span>
        <span class="name">onClicked</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="string">&quot;Button clicked!&quot;</span>)
    }
}</pre>
<p>The <tt>Button</tt> type can then be used in an application:</p>
<table class="generic">
 <tr valign="top" class="odd"><td ><pre class="qml"><span class="comment">// application.qml</span>
import QtQuick 2.0

<span class="type">Column</span> {
    <span class="type">Button</span> { <span class="name">width</span>: <span class="number">50</span>; <span class="name">height</span>: <span class="number">50</span> }
    <span class="type">Button</span> { <span class="name">x</span>: <span class="number">50</span>; <span class="name">width</span>: <span class="number">100</span>; <span class="name">height</span>: <span class="number">50</span>; <span class="name">color</span>: <span class="string">&quot;blue&quot;</span> }
    <span class="type">Button</span> { <span class="name">width</span>: <span class="number">50</span>; <span class="name">height</span>: <span class="number">50</span>; <span class="name">radius</span>: <span class="number">8</span> }
}</pre>
</td><td ><p class="centerAlign"><img src="images/button-types.png" alt="" /></p></td></tr>
</table>
<p>Please see the documentation about <a href="qtqml-documents-definetypes.html">defining object types in documents</a> for in-depth information on the topic.</p>
<a name="resource-loading-and-network-transparency"></a>
<h2>Resource Loading and Network Transparency</h2>
<p>It is important to note that QML is network-transparent. Applications can import documents from remote paths just as simply as documents from local paths. In fact, any <tt>url</tt> property may be assigned a remote or local URL, and the QML engine will handle any network communication involved.</p>
<p>Please see the <a href="qtqml-documents-networktransparency.html">Network Transparency</a> documentation for more information about network transparency in imports.</p>
<a name="scope-and-naming-resolution"></a>
<h2>Scope and Naming Resolution</h2>
<p>Expressions in documents usually involve objects or properties of objects, and since multiple objects may be defined and since different objects may have properties with the same name, some predefined symbol resolution semantics must be defined by QML. Please see the page on <a href="qtqml-documents-scope.html">scope and symbol resolution</a> for in-depth information about the topic.</p>
</div>
<!-- @@@qtqml-documents-topic.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
   subsidiaries. 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>    Digia, Qt and their respective logos are trademarks of Digia Plc     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>