Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5963

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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" />
<!-- qdeclarativetext.cpp -->
  <title>Qt 4.8: QML Text Element</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="qdeclarativeelements.html">QML Elements</a></li>
<li>QML Text Element</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<p class="naviNextPrevious headerNavi">
</p><p/>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signal-handlers">Signal Handlers</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QML Text Element</h1>
<span class="subtitle"></span>
<!-- $$$Text-brief -->
<p>The Text item allows you to add formatted text to a scene. <a href="#details">More...</a></p>
<!-- @@@Text -->
<p>Inherits <a href="qml-item.html">Item</a></p>
<p>This element was introduced in Qt 4.7.</p>
<ul>
<li><a href="qml-text-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-text.html#clip-prop">clip</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#color-prop">color</a></b></b> : color</li>
<li class="fn"><b><b><a href="qml-text.html#elide-prop">elide</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#font.bold-prop">font.bold</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#font.capitalization-prop">font.capitalization</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#font.family-prop">font.family</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-text.html#font.italic-prop">font.italic</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#font.letterSpacing-prop">font.letterSpacing</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-text.html#font.pixelSize-prop">font.pixelSize</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-text.html#font.pointSize-prop">font.pointSize</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-text.html#font.strikeout-prop">font.strikeout</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#font.underline-prop">font.underline</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#font.weight-prop">font.weight</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#font.wordSpacing-prop">font.wordSpacing</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-text.html#horizontalAlignment-prop">horizontalAlignment</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#lineCount-prop">lineCount</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-text.html#lineHeight-prop">lineHeight</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-text.html#lineHeightMode-prop">lineHeightMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#maximumLineCount-prop">maximumLineCount</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-text.html#paintedHeight-prop">paintedHeight</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-text.html#paintedWidth-prop">paintedWidth</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-text.html#smooth-prop">smooth</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#style-prop">style</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#styleColor-prop">styleColor</a></b></b> : color</li>
<li class="fn"><b><b><a href="qml-text.html#text-prop">text</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-text.html#textFormat-prop">textFormat</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#truncated-prop">truncated</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-text.html#verticalAlignment-prop">verticalAlignment</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-text.html#wrapMode-prop">wrapMode</a></b></b> : enumeration</li>
</ul>
<a name="signal-handlers"></a>
<h2>Signal Handlers</h2>
<ul>
<li class="fn"><b><b><a href="qml-text.html#onLinkActivated-signal">onLinkActivated</a></b></b></li>
</ul>
<!-- $$$Text-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>Text items can display both plain and rich text. For example, red text with a specific font and size can be defined like this:</p>
<pre class="qml"> <span class="type">Text</span> {
     <span class="name">text</span>: <span class="string">&quot;Hello World!&quot;</span>
     <span class="name">font</span>.family: <span class="string">&quot;Helvetica&quot;</span>
     <span class="name">font</span>.pointSize: <span class="number">24</span>
     <span class="name">color</span>: <span class="string">&quot;red&quot;</span>
 }</pre>
<p>Rich text is defined using HTML-style markup:</p>
<pre class="qml"> <span class="type">Text</span> {
     <span class="name">text</span>: <span class="string">&quot;&lt;b&gt;Hello&lt;/b&gt; &lt;i&gt;World!&lt;/i&gt;&quot;</span>
 }</pre>
<p class="centerAlign"><img src="images/declarative-text.png" alt="" /></p><p>If height and width are not explicitly set, Text will attempt to determine how much room is needed and set it accordingly. Unless <a href="qml-text.html#wrapMode-prop">wrapMode</a> is set, it will always prefer width to height (all text will be placed on a single line).</p>
<p>The <a href="qml-text.html#elide-prop">elide</a> property can alternatively be used to fit a single line of plain text to a set width.</p>
<p>Note that the <a href="richtext-html-subset.html">Supported HTML Subset</a> is limited. Also, if the text contains HTML img tags that load remote images, the text is reloaded.</p>
<p>Text provides read-only text. For editable text, see <a href="qml-textedit.html">TextEdit</a>.</p>
<p><b>See also </b><a href="declarative-text-fonts.html">Fonts example</a>.</p>
<!-- @@@Text -->
<h2>Property Documentation</h2>
<!-- $$$clip -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="clip-prop"></a><span class="name">clip</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds whether the text is clipped.</p>
<p>Note that if the text does not fit in the bounding rectangle it will be abruptly chopped.</p>
<p>If you want to display potentially long text in a limited space, you probably want to use <tt>elide</tt> instead.</p>
</div></div><!-- @@@clip -->
<br/>
<!-- $$$color -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="color-prop"></a><span class="name">color</span> : <span class="type"><a href="qml-color.html">color</a></span></p></td></tr></table></div><div class="qmldoc"><p>The text color.</p>
<p>An example of green text defined using hexadecimal notation:</p>
<pre class="qml"> <span class="type"><a href="qml-text.html">Text</a></span> {
     <span class="name">color</span>: <span class="string">&quot;#00FF00&quot;</span>
     <span class="name">text</span>: <span class="string">&quot;green text&quot;</span>
 }</pre>
<p>An example of steel blue text defined using an SVG color name:</p>
<pre class="qml"> <span class="type"><a href="qml-text.html">Text</a></span> {
     <span class="name">color</span>: <span class="string">&quot;steelblue&quot;</span>
     <span class="name">text</span>: <span class="string">&quot;blue text&quot;</span>
 }</pre>
</div></div><!-- @@@color -->
<br/>
<!-- $$$elide -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="elide-prop"></a><span class="name">elide</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Set this property to elide parts of the text fit to the Text item's width. The text will only elide if an explicit width has been set.</p>
<p>This property cannot be used with rich text.</p>
<p>Eliding can be:</p>
<ul>
<li>Text.ElideNone - the default</li>
<li>Text.ElideLeft</li>
<li>Text.ElideMiddle</li>
<li>Text.ElideRight</li>
</ul>
<p>If this property is set to Text.ElideRight, it can be used with multiline text. The text will only elide if <a href="qml-text.html#maximumLineCount-prop">maximumLineCount</a> has been set.</p>
<p>If the text is a multi-length string, and the mode is not <tt>Text.ElideNone</tt>, the first string that fits will be used, otherwise the last will be elided.</p>
<p>Multi-length strings are ordered from longest to shortest, separated by the Unicode &quot;String Terminator&quot; character <tt>U009C</tt> (write this in QML with <tt>&quot;\u009C&quot;</tt> or <tt>&quot;\x9C&quot;</tt>).</p>
</div></div><!-- @@@elide -->
<br/>
<!-- $$$font.bold -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.bold-prop"></a><span class="name">font.bold</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets whether the font weight is bold.</p>
</div></div><!-- @@@font.bold -->
<br/>
<!-- $$$font.capitalization -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.capitalization-prop"></a><span class="name">font.capitalization</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the capitalization for the text.</p>
<ul>
<li>Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.</li>
<li>Font.AllUppercase - This alters the text to be rendered in all uppercase type.</li>
<li>Font.AllLowercase - This alters the text to be rendered in all lowercase type.</li>
<li>Font.SmallCaps - This alters the text to be rendered in small-caps type.</li>
<li>Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.</li>
</ul>
<pre class="qml"> <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="string">&quot;Hello&quot;</span>; <span class="name">font</span>.capitalization: <span class="name">Font</span>.<span class="name">AllLowercase</span> }</pre>
</div></div><!-- @@@font.capitalization -->
<br/>
<!-- $$$font.family -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.family-prop"></a><span class="name">font.family</span> : <span class="type"><a href="qml-string.html">string</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the family name of the font.</p>
<p>The family name is case insensitive and may optionally include a foundry name, e.g&#x2e; &quot;Helvetica [Cronyx]&quot;. If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the font matching algorithm.</p>
</div></div><!-- @@@font.family -->
<br/>
<!-- $$$font.italic -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.italic-prop"></a><span class="name">font.italic</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets whether the font has an italic style.</p>
</div></div><!-- @@@font.italic -->
<br/>
<!-- $$$font.letterSpacing -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.letterSpacing-prop"></a><span class="name">font.letterSpacing</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the letter spacing for the font.</p>
<p>Letter spacing changes the default spacing between individual letters in the font. A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.</p>
</div></div><!-- @@@font.letterSpacing -->
<br/>
<!-- $$$font.pixelSize -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.pixelSize-prop"></a><span class="name">font.pixelSize</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the font size in pixels.</p>
<p>Using this function makes the font device dependent. Use <tt>pointSize</tt> to set the size of the font in a device independent manner.</p>
</div></div><!-- @@@font.pixelSize -->
<br/>
<!-- $$$font.pointSize -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.pointSize-prop"></a><span class="name">font.pointSize</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the font size in points. The point size must be greater than zero.</p>
</div></div><!-- @@@font.pointSize -->
<br/>
<!-- $$$font.strikeout -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.strikeout-prop"></a><span class="name">font.strikeout</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets whether the font has a strikeout style.</p>
</div></div><!-- @@@font.strikeout -->
<br/>
<!-- $$$font.underline -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.underline-prop"></a><span class="name">font.underline</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets whether the text is underlined.</p>
</div></div><!-- @@@font.underline -->
<br/>
<!-- $$$font.weight -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.weight-prop"></a><span class="name">font.weight</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the font's weight.</p>
<p>The weight can be one of:</p>
<ul>
<li>Font.Light</li>
<li>Font.Normal - the default</li>
<li>Font.DemiBold</li>
<li>Font.Bold</li>
<li>Font.Black</li>
</ul>
<pre class="qml"> <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="string">&quot;Hello&quot;</span>; <span class="name">font</span>.weight: <span class="name">Font</span>.<span class="name">DemiBold</span> }</pre>
</div></div><!-- @@@font.weight -->
<br/>
<!-- $$$font.wordSpacing -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="font.wordSpacing-prop"></a><span class="name">font.wordSpacing</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the word spacing for the font.</p>
<p>Word spacing changes the default spacing between individual words. A positive value increases the word spacing by a corresponding amount of pixels, while a negative value decreases the inter-word spacing accordingly.</p>
</div></div><!-- @@@font.wordSpacing -->
<br/>
<!-- $$$horizontalAlignment -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="horizontalAlignment-prop"></a><span class="name">horizontalAlignment</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr><tr valign="top" class="even"><td class="tblQmlPropNode"><p><a name="verticalAlignment-prop"></a><span class="name">verticalAlignment</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the horizontal and vertical alignment of the text within the Text items width and height. By default, the text is vertically aligned to the top. Horizontal alignment follows the natural alignment of the text, for example text that is read from left to right will be aligned to the left.</p>
<p>The valid values for <tt>horizontalAlignment</tt> are <tt>Text.AlignLeft</tt>, <tt>Text.AlignRight</tt>, <tt>Text.AlignHCenter</tt> and <tt>Text.AlignJustify</tt>. The valid values for <tt>verticalAlignment</tt> are <tt>Text.AlignTop</tt>, <tt>Text.AlignBottom</tt> and <tt>Text.AlignVCenter</tt>.</p>
<p>Note that for a single line of text, the size of the text is the area of the text. In this common case, all alignments are equivalent. If you want the text to be, say, centered in its parent, then you will need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to that of the parent.</p>
<p>When using the attached property <a href="qml-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a> to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property <tt>horizontalAlignment</tt> will remain unchanged. To query the effective horizontal alignment of Text, use the property <a href="qml-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a>.</p>
</div></div><!-- @@@horizontalAlignment -->
<br/>
<!-- $$$lineCount -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="lineCount-prop"></a><span class="qmlreadonly">read-only</span><span class="name">lineCount</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>Returns the number of lines visible in the text item.</p>
<p>This property is not supported for rich text.</p>
<p>This property group was introduced in  QtQuick 1.1.</p>
<p><b>See also </b><a href="qml-text.html#maximumLineCount-prop">maximumLineCount</a>.</p>
</div></div><!-- @@@lineCount -->
<br/>
<!-- $$$lineHeight -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="lineHeight-prop"></a><span class="name">lineHeight</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>Sets the line height for the text. The value can be in pixels or a multiplier depending on <a href="qml-text.html#lineHeightMode-prop">lineHeightMode</a>.</p>
<p>The default value is a multiplier of 1.0&#x2e; The line height must be a positive value.</p>
<p>This property group was introduced in  QtQuick 1.1.</p>
</div></div><!-- @@@lineHeight -->
<br/>
<!-- $$$lineHeightMode -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="lineHeightMode-prop"></a><span class="name">lineHeightMode</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property determines how the line height is specified. The possible values are:</p>
<ul>
<li>Text.ProportionalHeight (default) - this sets the spacing proportional to the line (as a multiplier). For example, set to 2 for double spacing.</li>
<li>Text.FixedHeight - this sets the line height to a fixed line height (in pixels).</li>
</ul>
</div></div><!-- @@@lineHeightMode -->
<br/>
<!-- $$$maximumLineCount -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="maximumLineCount-prop"></a><span class="name">maximumLineCount</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr></table></div><div class="qmldoc"><p>Set this property to limit the number of lines that the text item will show. If elide is set to Text.ElideRight, the text will be elided appropriately. By default, this is the value of the largest possible integer.</p>
<p>This property is not supported for rich text.</p>
<p>This property group was introduced in  QtQuick 1.1.</p>
<p><b>See also </b><a href="qml-text.html#lineCount-prop">lineCount</a> and <a href="qml-text.html#elide-prop">elide</a>.</p>
</div></div><!-- @@@maximumLineCount -->
<br/>
<!-- $$$paintedHeight -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="paintedHeight-prop"></a><span class="qmlreadonly">read-only</span><span class="name">paintedHeight</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>Returns the height of the text, including height past the height which is covered due to there being more text than fits in the set height.</p>
</div></div><!-- @@@paintedHeight -->
<br/>
<!-- $$$paintedWidth -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="paintedWidth-prop"></a><span class="qmlreadonly">read-only</span><span class="name">paintedWidth</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>Returns the width of the text, including width past the width which is covered due to insufficient wrapping if WrapMode is set.</p>
</div></div><!-- @@@paintedWidth -->
<br/>
<!-- $$$smooth -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="smooth-prop"></a><span class="name">smooth</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds whether the text is smoothly scaled or transformed.</p>
<p>Smooth filtering gives better visual quality, but is slower. If the item is displayed at its natural size, this property has no visual or performance effect.</p>
<p><b>Note:</b> Generally scaling artifacts are only visible if the item is stationary on the screen. A common pattern when animating an item is to disable smooth filtering at the beginning of the animation and reenable it at the conclusion.</p>
</div></div><!-- @@@smooth -->
<br/>
<!-- $$$style -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="style-prop"></a><span class="name">style</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Set an additional text style.</p>
<p>Supported text styles are:</p>
<ul>
<li>Text.Normal - the default</li>
<li>Text.Outline</li>
<li>Text.Raised</li>
<li>Text.Sunken</li>
</ul>
<pre class="qml"> <span class="type"><a href="qml-row.html">Row</a></span> {
     <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">font</span>.pointSize: <span class="number">24</span>; <span class="name">text</span>: <span class="string">&quot;Normal&quot;</span> }
     <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">font</span>.pointSize: <span class="number">24</span>; <span class="name">text</span>: <span class="string">&quot;Raised&quot;</span>; <span class="name">style</span>: <span class="name">Text</span>.<span class="name">Raised</span>; <span class="name">styleColor</span>: <span class="string">&quot;#AAAAAA&quot;</span> }
     <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">font</span>.pointSize: <span class="number">24</span>; <span class="name">text</span>: <span class="string">&quot;Outline&quot;</span>;<span class="name">style</span>: <span class="name">Text</span>.<span class="name">Outline</span>; <span class="name">styleColor</span>: <span class="string">&quot;red&quot;</span> }
     <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">font</span>.pointSize: <span class="number">24</span>; <span class="name">text</span>: <span class="string">&quot;Sunken&quot;</span>; <span class="name">style</span>: <span class="name">Text</span>.<span class="name">Sunken</span>; <span class="name">styleColor</span>: <span class="string">&quot;#AAAAAA&quot;</span> }
 }</pre>
<p class="centerAlign"><img src="images/declarative-textstyle.png" alt="" /></p></div></div><!-- @@@style -->
<br/>
<!-- $$$styleColor -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="styleColor-prop"></a><span class="name">styleColor</span> : <span class="type"><a href="qml-text.html#color-prop">color</a></span></p></td></tr></table></div><div class="qmldoc"><p>Defines the secondary color used by text styles.</p>
<p><tt>styleColor</tt> is used as the outline color for outlined text, and as the shadow color for raised or sunken text. If no style has been set, it is not used at all.</p>
<pre class="qml"> <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">font</span>.pointSize: <span class="number">18</span>; <span class="name">text</span>: <span class="string">&quot;hello&quot;</span>; <span class="name">style</span>: <span class="name">Text</span>.<span class="name">Raised</span>; <span class="name">styleColor</span>: <span class="string">&quot;gray&quot;</span> }</pre>
<p><b>See also </b><a href="qml-text.html#style-prop">style</a>.</p>
</div></div><!-- @@@styleColor -->
<br/>
<!-- $$$text -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="text-prop"></a><span class="name">text</span> : <span class="type"><a href="qml-string.html">string</a></span></p></td></tr></table></div><div class="qmldoc"><p>The text to display. Text supports both plain and rich text strings.</p>
<p>The item will try to automatically determine whether the text should be treated as rich text. This determination is made using <a href="qt.html#mightBeRichText">Qt::mightBeRichText()</a>.</p>
</div></div><!-- @@@text -->
<br/>
<!-- $$$textFormat -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="textFormat-prop"></a><span class="name">textFormat</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>The way the text property should be displayed.</p>
<p>Supported text formats are:</p>
<ul>
<li>Text.AutoText (default)</li>
<li>Text.PlainText</li>
<li>Text.RichText</li>
<li>Text.StyledText</li>
</ul>
<p>If the text format is <tt>Text.AutoText</tt> the text element will automatically determine whether the text should be treated as rich text. This determination is made using <a href="qt.html#mightBeRichText">Qt::mightBeRichText()</a>.</p>
<p>Text.StyledText is an optimized format supporting some basic text styling markup, in the style of html 3.2:</p>
<pre class="cpp"> <span class="operator">&lt;</span>font size<span class="operator">=</span><span class="string">&quot;4&quot;</span> color<span class="operator">=</span><span class="string">&quot;#ff0000&quot;</span><span class="operator">&gt;</span>font size <span class="keyword">and</span> color<span class="operator">&lt;</span><span class="operator">/</span>font<span class="operator">&gt;</span>
 <span class="operator">&lt;</span>b<span class="operator">&gt;</span>bold<span class="operator">&lt;</span><span class="operator">/</span>b<span class="operator">&gt;</span>
 <span class="operator">&lt;</span>i<span class="operator">&gt;</span>italic<span class="operator">&lt;</span><span class="operator">/</span>i<span class="operator">&gt;</span>
 <span class="operator">&lt;</span>br<span class="operator">&gt;</span>
 <span class="operator">&amp;</span>gt; <span class="operator">&amp;</span>lt; <span class="operator">&amp;</span>amp;</pre>
<p><tt>Text.StyledText</tt> parser is strict, requiring tags to be correctly nested.</p>
<table class="generic">
<tr valign="top" class="odd"><td ><pre class="qml"> <span class="type"><a href="qml-column.html">Column</a></span> {
     <span class="type"><a href="qml-text.html">Text</a></span> {
         <span class="name">font</span>.pointSize: <span class="number">24</span>
         <span class="name">text</span>: <span class="string">&quot;&lt;b&gt;Hello&lt;/b&gt; &lt;i&gt;World!&lt;/i&gt;&quot;</span>
     }
     <span class="type"><a href="qml-text.html">Text</a></span> {
         <span class="name">font</span>.pointSize: <span class="number">24</span>
         <span class="name">textFormat</span>: <span class="name">Text</span>.<span class="name">RichText</span>
         <span class="name">text</span>: <span class="string">&quot;&lt;b&gt;Hello&lt;/b&gt; &lt;i&gt;World!&lt;/i&gt;&quot;</span>
     }
     <span class="type"><a href="qml-text.html">Text</a></span> {
         <span class="name">font</span>.pointSize: <span class="number">24</span>
         <span class="name">textFormat</span>: <span class="name">Text</span>.<span class="name">PlainText</span>
         <span class="name">text</span>: <span class="string">&quot;&lt;b&gt;Hello&lt;/b&gt; &lt;i&gt;World!&lt;/i&gt;&quot;</span>
     }
 }</pre>
</td><td ><p class="centerAlign"><img src="images/declarative-textformat.png" alt="" /></p></td></tr>
</table>
</div></div><!-- @@@textFormat -->
<br/>
<!-- $$$truncated -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="even"><td class="tblQmlPropNode"><p><a name="truncated-prop"></a><span class="qmlreadonly">read-only</span><span class="name">truncated</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Returns true if the text has been truncated due to <a href="qml-text.html#maximumLineCount-prop">maximumLineCount</a> or <a href="qml-text.html#elide-prop">elide</a>.</p>
<p>This property is not supported for rich text.</p>
<p>This property group was introduced in  QtQuick 1.1.</p>
<p><b>See also </b><a href="qml-text.html#maximumLineCount-prop">maximumLineCount</a> and <a href="qml-text.html#elide-prop">elide</a>.</p>
</div></div><!-- @@@truncated -->
<br/>
<!-- $$$wrapMode -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="wrapMode-prop"></a><span class="name">wrapMode</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>Set this property to wrap the text to the Text item's width. The text will only wrap if an explicit width has been set. wrapMode can be one of:</p>
<ul>
<li>Text.NoWrap (default) - no wrapping will be performed. If the text contains insufficient newlines, then <a href="qml-text.html#paintedWidth-prop">paintedWidth</a> will exceed a set width.</li>
<li>Text.WordWrap - wrapping is done on word boundaries only. If a word is too long, <a href="qml-text.html#paintedWidth-prop">paintedWidth</a> will exceed a set width.</li>
<li>Text.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word.</li>
<li>Text.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.</li>
</ul>
</div></div><!-- @@@wrapMode -->
<br/>
<h2>Signal Handler Documentation</h2>
<!-- $$$onLinkActivated -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="onLinkActivated-signal"></a>Text::<span class="name">onLinkActivated</span> ( <span class="type"><a href="qml-string.html">string</a></span> <i>link</i> )</p></td></tr></table></div><div class="qmldoc"><p>This handler is called when the user clicks on a link embedded in the text. The link must be in rich text or HTML format and the <i>link</i> string provides access to the particular link.</p>
<pre class="qml">     <span class="type"><a href="qml-text.html">Text</a></span> {
             <span class="name">textFormat</span>: <span class="name">Text</span>.<span class="name">RichText</span>
             <span class="name">text</span>: <span class="string">&quot;The main website is at &lt;a href=\&quot;http://qt.nokia.com\&quot;&gt;Nokia Qt DF&lt;/a&gt;.&quot;</span>
             <span class="name">onLinkActivated</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="name">link</span> <span class="operator">+</span> <span class="string">&quot; link activated&quot;</span>)
     }</pre>
<p>The example code will display the text &quot;The main website is at <a href="http://qt.nokia.com">Nokia Qt DF</a>.&quot;</p>
<p>Clicking on the highlighted link will output <tt>http://qt.nokia.com link activated</tt> to the console.</p>
</div></div><!-- @@@onLinkActivated -->
<br/>
<p class="naviNextPrevious footerNavi">
</p>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </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.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      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. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>