Sophie

Sophie

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

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" />
<!-- qdeclarativeimage.cpp -->
  <title>Qt 4.8: QML Image 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 Image 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="#details">Detailed Description</a></li>
<li class="level2"><a href="#example-usage">Example Usage</a></li>
<li class="level2"><a href="#performance">Performance</a></li>
</ul>
</div>
<h1 class="title">QML Image Element</h1>
<span class="subtitle"></span>
<!-- $$$Image-brief -->
<p>The Image element displays an image in a declarative user interface <a href="#details">More...</a></p>
<!-- @@@Image -->
<p>Inherits <a href="qml-item.html">Item</a></p>
<p>Inherited by <a href="qml-animatedimage.html">AnimatedImage</a>.</p>
<p>This element was introduced in Qt 4.7.</p>
<ul>
<li><a href="qml-image-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-image.html#asynchronous-prop">asynchronous</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-image.html#cache-prop">cache</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-image.html#fillMode-prop">fillMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-image.html#mirror-prop">mirror</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-image.html#paintedHeight-prop">paintedHeight</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-image.html#paintedWidth-prop">paintedWidth</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-image.html#progress-prop">progress</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-image.html#smooth-prop">smooth</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-image.html#source-prop">source</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-image.html#sourceSize-prop">sourceSize</a></b></b> : QSize</li>
<li class="fn"><b><b><a href="qml-image.html#status-prop">status</a></b></b> : enumeration</li>
</ul>
<!-- $$$Image-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>The Image element is used to display images in a declarative user interface.</p>
<p>The source of the image is specified as a URL using the <a href="qml-image.html#source-prop">source</a> property. Images can be supplied in any of the standard image formats supported by Qt, including bitmap formats such as PNG and JPEG, and vector graphics formats such as SVG. If you need to display animated images, use the <a href="qml-animatedimage.html">AnimatedImage</a> element.</p>
<p>If the <a href="qml-item.html#width-prop">width</a> and <a href="qml-item.html#height-prop">height</a> properties are not specified, the Image element automatically uses the size of the loaded image. By default, specifying the width and height of the element causes the image to be scaled to that size. This behavior can be changed by setting the <a href="qml-image.html#fillMode-prop">fillMode</a> property, allowing the image to be stretched and tiled instead.</p>
<a name="example-usage"></a>
<h2>Example Usage</h2>
<p>The following example shows the simplest usage of the Image element.</p>
<pre class="qml"> import QtQuick 1.0

 <span class="type">Image</span> {
     <span class="name">source</span>: <span class="string">&quot;pics/qtlogo.png&quot;</span>
 }</pre>
<div style="float: left; margin-right: 2em"><p class="centerAlign"><img src="images/declarative-qtlogo.png" alt="" /></p></div><br style="clear: both" /><a name="performance"></a>
<h2>Performance</h2>
<p>By default, locally available images are loaded immediately, and the user interface is blocked until loading is complete. If a large image is to be loaded, it may be preferable to load the image in a low priority thread, by enabling the <a href="qml-image.html#asynchronous-prop">asynchronous</a> property.</p>
<p>If the image is obtained from a network rather than a local resource, it is automatically loaded asynchronously, and the <a href="qml-image.html#progress-prop">progress</a> and <a href="qml-image.html#status-prop">status</a> properties are updated as appropriate.</p>
<p>Images are cached and shared internally, so if several Image elements have the same <a href="qml-image.html#source-prop">source</a>, only one copy of the image will be loaded.</p>
<p><b>Note</b>: Images are often the greatest user of memory in QML user interfaces. It is recommended that images which do not form part of the user interface have their size bounded via the <a href="qml-image.html#sourceSize-prop">sourceSize</a> property. This is especially important for content that is loaded from external sources or provided by the user.</p>
<p><b>See also </b><a href="declarative-imageelements-image.html">Image example</a> and <a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a>.</p>
<!-- @@@Image -->
<h2>Property Documentation</h2>
<!-- $$$asynchronous -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="asynchronous-prop"></a><span class="name">asynchronous</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Specifies that images on the local filesystem should be loaded asynchronously in a separate thread. The default value is false, causing the user interface thread to block while the image is loaded. Setting <i>asynchronous</i> to true is useful where maintaining a responsive user interface is more desirable than having images immediately visible.</p>
<p>Note that this property is only valid for images read from the local filesystem. Images loaded via a network resource (e.g&#x2e; HTTP) are always loaded asynchonously.</p>
</div></div><!-- @@@asynchronous -->
<br/>
<!-- $$$cache -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="cache-prop"></a><span class="name">cache</span> : <span class="type"><a href="qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>Specifies whether the image should be cached. The default value is true. Setting <i>cache</i> to false is useful when dealing with large images, to make sure that they aren't cached at the expense of small 'ui element' images.</p>
<p>This property group was introduced in  QtQuick 1.1.</p>
</div></div><!-- @@@cache -->
<br/>
<!-- $$$fillMode -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="fillMode-prop"></a><span class="name">fillMode</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 define what happens when the source image has a different size than the item.</p>
<ul>
<li>Image.Stretch - the image is scaled to fit</li>
<li>Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping</li>
<li>Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary</li>
<li>Image.Tile - the image is duplicated horizontally and vertically</li>
<li>Image.TileVertically - the image is stretched horizontally and tiled vertically</li>
<li>Image.TileHorizontally - the image is stretched vertically and tiled horizontally</li>
</ul>
<table class="generic">
<tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/declarative-qtlogo-stretch.png" alt="" /></p></td><td >Stretch (default)<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">width</span>: <span class="number">130</span>; <span class="name">height</span>: <span class="number">100</span>
     <span class="name">smooth</span>: <span class="number">true</span>
     <span class="name">source</span>: <span class="string">&quot;qtlogo.png&quot;</span>
 }</pre>
</td></tr>
<tr valign="top" class="even"><td ><p class="centerAlign"><img src="images/declarative-qtlogo-preserveaspectfit.png" alt="" /></p></td><td >PreserveAspectFit<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">width</span>: <span class="number">130</span>; <span class="name">height</span>: <span class="number">100</span>
     <span class="name">fillMode</span>: <span class="name">Image</span>.<span class="name">PreserveAspectFit</span>
     <span class="name">smooth</span>: <span class="number">true</span>
     <span class="name">source</span>: <span class="string">&quot;qtlogo.png&quot;</span>
 }</pre>
</td></tr>
<tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/declarative-qtlogo-preserveaspectcrop.png" alt="" /></p></td><td >PreserveAspectCrop<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">width</span>: <span class="number">130</span>; <span class="name">height</span>: <span class="number">100</span>
     <span class="name">fillMode</span>: <span class="name">Image</span>.<span class="name">PreserveAspectCrop</span>
     <span class="name">smooth</span>: <span class="number">true</span>
     <span class="name">source</span>: <span class="string">&quot;qtlogo.png&quot;</span>
     <span class="name">clip</span>: <span class="number">true</span>
 }</pre>
</td></tr>
<tr valign="top" class="even"><td ><p class="centerAlign"><img src="images/declarative-qtlogo-tile.png" alt="" /></p></td><td >Tile<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">width</span>: <span class="number">120</span>; <span class="name">height</span>: <span class="number">120</span>
     <span class="name">fillMode</span>: <span class="name">Image</span>.<span class="name">Tile</span>
     <span class="name">source</span>: <span class="string">&quot;qtlogo.png&quot;</span>
 }</pre>
</td></tr>
<tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/declarative-qtlogo-tilevertically.png" alt="" /></p></td><td >TileVertically<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">width</span>: <span class="number">120</span>; <span class="name">height</span>: <span class="number">120</span>
     <span class="name">fillMode</span>: <span class="name">Image</span>.<span class="name">TileVertically</span>
     <span class="name">smooth</span>: <span class="number">true</span>
     <span class="name">source</span>: <span class="string">&quot;qtlogo.png&quot;</span>
 }</pre>
</td></tr>
<tr valign="top" class="even"><td ><p class="centerAlign"><img src="images/declarative-qtlogo-tilehorizontally.png" alt="" /></p></td><td >TileHorizontally<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">width</span>: <span class="number">120</span>; <span class="name">height</span>: <span class="number">120</span>
     <span class="name">fillMode</span>: <span class="name">Image</span>.<span class="name">TileHorizontally</span>
     <span class="name">smooth</span>: <span class="number">true</span>
     <span class="name">source</span>: <span class="string">&quot;qtlogo.png&quot;</span>
 }</pre>
</td></tr>
</table>
<p>Note that <tt>clip</tt> is <tt>false</tt> by default which means that the element might paint outside its bounding rectangle even if the fillMode is set to <tt>PreserveAspectCrop</tt>.</p>
<p><b>See also </b><a href="declarative-imageelements-image.html">Image example</a>.</p>
</div></div><!-- @@@fillMode -->
<br/>
<!-- $$$mirror -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="mirror-prop"></a><span class="name">mirror</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 image should be horizontally inverted (effectively displaying a mirrored image).</p>
<p>The default value is false.</p>
<p>This property group was introduced in  QtQuick 1.1.</p>
</div></div><!-- @@@mirror -->
<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><tr valign="top" class="even"><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>These properties hold the size of the image that is actually painted. In most cases it is the same as <tt>width</tt> and <tt>height</tt>, but when using a <tt>fillMode</tt> <tt>PreserveAspectFit</tt> or <tt>fillMode</tt> <tt>PreserveAspectCrop</tt> <tt>paintedWidth</tt> or <tt>paintedHeight</tt> can be smaller or larger than <tt>width</tt> and <tt>height</tt> of the Image element.</p>
</div></div><!-- @@@paintedWidth -->
<br/>
<!-- $$$progress -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="progress-prop"></a><span class="qmlreadonly">read-only</span><span class="name">progress</span> : <span class="type"><a href="qml-real.html">real</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the progress of image loading, from 0.0 (nothing loaded) to 1.0 (finished).</p>
<p><b>See also </b><a href="qml-image.html#status-prop">status</a>.</p>
</div></div><!-- @@@progress -->
<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>Set this property if you want the image to be smoothly filtered when scaled or transformed. Smooth filtering gives better visual quality, but is slower. If the image 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 image is stationary on the screen. A common pattern when animating an image is to disable smooth filtering at the beginning of the animation and reenable it at the conclusion.</p>
</div></div><!-- @@@smooth -->
<br/>
<!-- $$$source -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="source-prop"></a><span class="name">source</span> : <span class="type"><a href="qml-url.html">url</a></span></p></td></tr></table></div><div class="qmldoc"><p>Image can handle any image format supported by Qt, loaded from any URL scheme supported by Qt.</p>
<p>The URL may be absolute, or relative to the URL of the component.</p>
<p><b>See also </b><a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a>.</p>
</div></div><!-- @@@source -->
<br/>
<!-- $$$sourceSize -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="sourceSize-prop"></a><span class="name">sourceSize</span> : <span class="type"><a href="qsize.html">QSize</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the actual width and height of the loaded image.</p>
<p>Unlike the <a href="qml-item.html#width-prop">width</a> and <a href="qml-item.html#height-prop">height</a> properties, which scale the painting of the image, this property sets the actual number of pixels stored for the loaded image so that large images do not use more memory than necessary. For example, this ensures the image in memory is no larger than 1024x1024 pixels, regardless of the Image's <a href="qml-item.html#width-prop">width</a> and <a href="qml-item.html#height-prop">height</a> values:</p>
<pre class="cpp"> Rectangle {
     width: <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     height: <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>

     Image {
        anchors<span class="operator">.</span>fill: parent
        source: <span class="string">&quot;reallyBigImage.jpg&quot;</span>
        sourceSize<span class="operator">.</span>width: <span class="number">1024</span>
        sourceSize<span class="operator">.</span>height: <span class="number">1024</span>
     }
 }</pre>
<p>If the image's actual size is larger than the sourceSize, the image is scaled down. If only one dimension of the size is set to greater than 0, the other dimension is set in proportion to preserve the source image's aspect ratio. (The <a href="qml-image.html#fillMode-prop">fillMode</a> is independent of this.)</p>
<p>If the source is an instrinsically scalable image (eg. SVG), this property determines the size of the loaded image regardless of intrinsic size. Avoid changing this property dynamically; rendering an SVG is <i>slow</i> compared to an image.</p>
<p>If the source is a non-scalable image (eg. JPEG), the loaded image will be no greater than this property specifies. For some formats (currently only JPEG), the whole image will never actually be loaded into memory.</p>
<p>Since QtQuick 1.1 the sourceSize can be cleared to the natural size of the image by setting sourceSize to <tt>undefined</tt>.</p>
<p><b>Note:</b> <i>Changing this property dynamically causes the image source to be reloaded, potentially even from the network, if it is not in the disk cache.</i></p>
</div></div><!-- @@@sourceSize -->
<br/>
<!-- $$$status -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="status-prop"></a><span class="qmlreadonly">read-only</span><span class="name">status</span> : <span class="type"><a href="qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the status of image loading. It can be one of:</p>
<ul>
<li>Image.Null - no image has been set</li>
<li>Image.Ready - the image has been loaded</li>
<li>Image.Loading - the image is currently being loaded</li>
<li>Image.Error - an error occurred while loading the image</li>
</ul>
<p>Use this status to provide an update or respond to the status change in some way. For example, you could:</p>
<ul>
<li>Trigger a state change:<pre class="qml"> <span class="type"><a href="qml-state.html">State</a></span> { <span class="name">name</span>: <span class="string">'loaded'</span>; <span class="name">when</span>: <span class="name">image</span>.<span class="name">status</span> <span class="operator">==</span> <span class="name">Image</span>.<span class="name">Ready</span> }</pre>
</li>
<li>Implement an <tt>onStatusChanged</tt> signal handler:<pre class="qml"> <span class="type"><a href="qml-image.html">Image</a></span> {
     <span class="name">id</span>: <span class="name">image</span>
     <span class="name">onStatusChanged</span>: <span class="keyword">if</span> (<span class="name">image</span>.<span class="name">status</span> <span class="operator">==</span> <span class="name">Image</span>.<span class="name">Ready</span>) <span class="name">console</span>.<span class="name">log</span>(<span class="string">'Loaded'</span>)
 }</pre>
</li>
<li>Bind to the status value:<pre class="qml"> <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="name">image</span>.<span class="name">status</span> <span class="operator">==</span> <span class="name">Image</span>.<span class="name">Ready</span> ? <span class="string">'Loaded'</span> : <span class="string">'Not loaded'</span> }</pre>
</li>
</ul>
<p><b>See also </b><a href="qml-image.html#progress-prop">progress</a>.</p>
</div></div><!-- @@@status -->
<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>