Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates > by-pkgid > 6e2327ca1c896c6d674ae53117299f21 > files > 1735

qtdeclarative5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- text.qdoc -->
  <title>Qt Quick Examples - Text | Qt Quick 5.12.6</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.12</td><td ><a href="qtquick-index.html">Qt Quick</a></td><td >Qt Quick Examples - Text</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.6 Reference Documentation</a></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="#hello">Hello</a></li>
<li class="level1"><a href="#fonts">Fonts</a></li>
<li class="level1"><a href="#available-fonts">Available Fonts</a></li>
<li class="level1"><a href="#banner">Banner</a></li>
<li class="level1"><a href="#img-tag">Img Tag</a></li>
<li class="level1"><a href="#text-layout">Text Layout</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt Quick Examples - Text</h1>
<span class="subtitle"></span>
<!-- $$$text-brief -->
<p>This is a collection of QML examples relating to text.</p>
<!-- @@@text -->
<!-- $$$text-description -->
<div class="descr"> <a name="details"></a>
<p class="centerAlign"><img src="images/qml-text-example.png" alt="" /></p><p><i>Text</i> is a collection of small QML examples relating to text. Each example is a small QML file, usually containing or emphasizing a particular type or feature. You can run and observe the behavior of each example.</p>
<a name="hello"></a>
<h2 id="hello">Hello</h2>
<p><i>Hello</i> shows how to change and animate the letter spacing of a <a href="qml-qtquick-text.html">Text</a> type. It uses a sequential animation to first animate the font.letterSpacing property from <code>0</code> to <code>50</code> over three seconds and then move the text to a random position on screen:</p>
<pre class="qml">

              SequentialAnimation on font.letterSpacing {
                  loops: Animation.Infinite;
                  NumberAnimation { from: 0; to: 50; easing.type: Easing.InQuad; duration: 3000 }
                  ScriptAction {
                      script: {
                          container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
                          container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
                      }
                  }
              }

</pre>
<a name="fonts"></a>
<h2 id="fonts">Fonts</h2>
<p><i>Fonts</i> shows different ways of using fonts with the <a href="qml-qtquick-text.html">Text</a> type. Simply by name, using the font.family property directly:</p>
<pre class="qml">

              font.family: "Times"

</pre>
<p>or using a <a href="qml-qtquick-fontloader.html">FontLoader</a> type:</p>
<pre class="qml">

      FontLoader { id: fixedFont; name: "Courier" }

</pre>
<p>or using a <a href="qml-qtquick-fontloader.html">FontLoader</a> and specifying a local font file:</p>
<pre class="qml">

      FontLoader { id: localFont; source: "content/fonts/tarzeau_ocr_a.ttf" }

</pre>
<p>or finally using a <a href="qml-qtquick-fontloader.html">FontLoader</a> and specifying a remote font file:</p>
<pre class="qml">

      FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }

</pre>
<a name="available-fonts"></a>
<h2 id="available-fonts">Available Fonts</h2>
<p><i>Available Fonts</i> shows how to use the Qt global object and a list view to display all the fonts available on the system. The <a href="qml-qtquick-listview.html">ListView</a> type uses the list of fonts available as its model:</p>
<pre class="qml">

          model: Qt.fontFamilies()

</pre>
<p>Inside the delegate, the font family is set with the modelData:</p>
<pre class="qml">

                  font.family: modelData

</pre>
<a name="banner"></a>
<h2 id="banner">Banner</h2>
<p><i>Banner</i> is a simple example showing how to create a banner using a row of text types and a <a href="qml-qtquick-numberanimation.html">NumberAnimation</a>.</p>
<a name="img-tag"></a>
<h2 id="img-tag">Img Tag</h2>
<p><i>Img tag</i> shows different ways of displaying images in text objects using the <code>&lt;img&gt;</code> tag.</p>
<a name="text-layout"></a>
<h2 id="text-layout">Text Layout</h2>
<p><i>Text Layout</i> shows how to create a more complex layout for a text item. This example lays out the text in two columns using the onLineLaidOut handler that allows you to position and resize each line:</p>
<pre class="qml">

          onLineLaidOut: {
              line.width = width / 2  - (margin)

              if (line.y + line.height >= height) {
                  line.y -= height - margin
                  line.x = width / 2 + margin
              }
          }

</pre>
<p>Files:</p>
<ul>
<li><a href="qtquick-text-fonts-availablefonts-qml.html">text/fonts/availableFonts.qml</a></li>
<li><a href="qtquick-text-fonts-banner-qml.html">text/fonts/banner.qml</a></li>
<li><a href="qtquick-text-fonts-fonts-qml.html">text/fonts/fonts.qml</a></li>
<li><a href="qtquick-text-fonts-hello-qml.html">text/fonts/hello.qml</a></li>
<li><a href="qtquick-text-imgtag-textwithimage-qml.html">text/imgtag/TextWithImage.qml</a></li>
<li><a href="qtquick-text-imgtag-imgtag-qml.html">text/imgtag/imgtag.qml</a></li>
<li><a href="qtquick-text-main-cpp.html">text/main.cpp</a></li>
<li><a href="qtquick-text-styledtext-layout-qml.html">text/styledtext-layout.qml</a></li>
<li><a href="qtquick-text-text-pro.html">text/text.pro</a></li>
<li><a href="qtquick-text-text-qml.html">text/text.qml</a></li>
<li><a href="qtquick-text-text-qmlproject.html">text/text.qmlproject</a></li>
<li><a href="qtquick-text-text-qrc.html">text/text.qrc</a></li>
<li><a href="qtquick-text-textselection-textselection-qml.html">text/textselection/textselection.qml</a></li>
</ul>
<p>Images:</p>
<ul>
<li><a href="images/used-in-examples/text/imgtag/images/face-sad.png">text/imgtag/images/face-sad.png</a></li>
<li><a href="images/used-in-examples/text/imgtag/images/face-smile-big.png">text/imgtag/images/face-smile-big.png</a></li>
<li><a href="images/used-in-examples/text/imgtag/images/face-smile.png">text/imgtag/images/face-smile.png</a></li>
<li><a href="images/used-in-examples/text/imgtag/images/heart200.png">text/imgtag/images/heart200.png</a></li>
<li><a href="images/used-in-examples/text/imgtag/images/qtlogo.png">text/imgtag/images/qtlogo.png</a></li>
<li><a href="images/used-in-examples/text/imgtag/images/starfish_2.png">text/imgtag/images/starfish_2.png</a></li>
<li><a href="images/used-in-examples/text/textselection/pics/endHandle.png">text/textselection/pics/endHandle.png</a></li>
<li><a href="images/used-in-examples/text/textselection/pics/startHandle.png">text/textselection/pics/startHandle.png</a></li>
</ul>
</div>
<!-- @@@text -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>