Sophie

Sophie

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

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" />
<!-- qgraphicsanchorlayout.cpp -->
  <title>Qt 4.8: QGraphicsAnchorLayout Class Reference</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="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QGraphicsAnchorLayout</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">
<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="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#size-hints-and-size-policies-in-an-anchor-layout">Size Hints and Size Policies in an Anchor Layout</a></li>
<li class="level2"><a href="#spacing-within-an-anchor-layout">Spacing within an Anchor Layout</a></li>
<li class="level2"><a href="#known-issues">Known issues</a></li>
</ul>
</div>
<h1 class="title">QGraphicsAnchorLayout Class Reference</h1>
<!-- $$$QGraphicsAnchorLayout-brief -->
<p>The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics View. <a href="#details">More...</a></p>
<!-- @@@QGraphicsAnchorLayout -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QGraphicsAnchorLayout&gt;</span></pre><p><b>Inherits: </b><a href="qgraphicslayout.html">QGraphicsLayout</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qgraphicsanchorlayout-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#QGraphicsAnchorLayout">QGraphicsAnchorLayout</a></b> ( QGraphicsLayoutItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#dtor.QGraphicsAnchorLayout">~QGraphicsAnchorLayout</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsAnchor * </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#addAnchor">addAnchor</a></b> ( QGraphicsLayoutItem * <i>firstItem</i>, Qt::AnchorPoint <i>firstEdge</i>, QGraphicsLayoutItem * <i>secondItem</i>, Qt::AnchorPoint <i>secondEdge</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#addAnchors">addAnchors</a></b> ( QGraphicsLayoutItem * <i>firstItem</i>, QGraphicsLayoutItem * <i>secondItem</i>, Qt::Orientations <i>orientations</i> = Qt::Horizontal | Qt::Vertical )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#addCornerAnchors">addCornerAnchors</a></b> ( QGraphicsLayoutItem * <i>firstItem</i>, Qt::Corner <i>firstCorner</i>, QGraphicsLayoutItem * <i>secondItem</i>, Qt::Corner <i>secondCorner</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsAnchor * </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#anchor">anchor</a></b> ( QGraphicsLayoutItem * <i>firstItem</i>, Qt::AnchorPoint <i>firstEdge</i>, QGraphicsLayoutItem * <i>secondItem</i>, Qt::AnchorPoint <i>secondEdge</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#horizontalSpacing">horizontalSpacing</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#setHorizontalSpacing">setHorizontalSpacing</a></b> ( qreal <i>spacing</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#setSpacing">setSpacing</a></b> ( qreal <i>spacing</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#setVerticalSpacing">setVerticalSpacing</a></b> ( qreal <i>spacing</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#verticalSpacing">verticalSpacing</a></b> () const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#invalidate">invalidate</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QGraphicsLayoutItem * </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#itemAt">itemAt</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#removeAt">removeAt</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#setGeometry">setGeometry</a></b> ( const QRectF &amp; <i>geom</i> )</td></tr>
</table>
<ul>
<li class="fn">10 public functions inherited from <a href="qgraphicslayout.html#public-functions">QGraphicsLayout</a></li>
<li class="fn">35 public functions inherited from <a href="qgraphicslayoutitem.html#public-functions">QGraphicsLayoutItem</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsanchorlayout.html#sizeHint">sizeHint</a></b> ( Qt::SizeHint <i>which</i>, const QSizeF &amp; <i>constraint</i> = QSizeF() ) const</td></tr>
</table>
<ul>
<li class="fn">1 protected function inherited from <a href="qgraphicslayout.html#protected-functions">QGraphicsLayout</a></li>
<li class="fn">3 protected functions inherited from <a href="qgraphicslayoutitem.html#protected-functions">QGraphicsLayoutItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 static public members inherited from <a href="qgraphicslayout.html#static-public-members">QGraphicsLayout</a></li>
<li class="fn">1 protected function inherited from <a href="qgraphicslayout.html#protected-functions">QGraphicsLayout</a></li>
<li class="fn">3 protected functions inherited from <a href="qgraphicslayoutitem.html#protected-functions">QGraphicsLayoutItem</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGraphicsAnchorLayout-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics View.</p>
<p>The anchor layout allows developers to specify how widgets should be placed relative to each other, and to the layout itself. The specification is made by adding anchors to the layout by calling <a href="qgraphicsanchorlayout.html#addAnchor">addAnchor</a>(), <a href="qgraphicsanchorlayout.html#addAnchors">addAnchors</a>() or <a href="qgraphicsanchorlayout.html#addCornerAnchors">addCornerAnchors</a>().</p>
<p>Existing anchors in the layout can be accessed with the <a href="qgraphicsanchorlayout.html#anchor">anchor</a>() function. Items that are anchored are automatically added to the layout, and if items are removed, all their anchors will be automatically removed.</p>
<div class="float-left"><p><img src="images/simpleanchorlayout-example.png" alt="Using an anchor layout to align simple colored widgets." /></p>
</div><p>Anchors are always set up between edges of an item, where the &quot;center&quot; is also considered to be an edge. Consider the following example:</p>
<pre class="cpp"> layout<span class="operator">-</span><span class="operator">&gt;</span>addAnchor(b<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AnchorLeft<span class="operator">,</span> a<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AnchorRight);
 layout<span class="operator">-</span><span class="operator">&gt;</span>addAnchor(b<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AnchorTop<span class="operator">,</span> a<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AnchorBottom);</pre>
<p>Here, the right edge of item <tt>a</tt> is anchored to the left edge of item <tt>b</tt> and the bottom edge of item <tt>a</tt> is anchored to the top edge of item <tt>b</tt>, with the result that item <tt>b</tt> will be placed diagonally to the right and below item <tt>b</tt>.</p>
<p>The <a href="qgraphicsanchorlayout.html#addCornerAnchors">addCornerAnchors</a>() function provides a simpler way of anchoring the corners of two widgets than the two individual calls to <a href="qgraphicsanchorlayout.html#addAnchor">addAnchor</a>() shown in the code above. Here, we see how a widget can be anchored to the top-left corner of the enclosing layout:</p>
<pre class="cpp"> layout<span class="operator">-</span><span class="operator">&gt;</span>addCornerAnchors(a<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>TopLeftCorner<span class="operator">,</span> layout<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>TopLeftCorner);</pre>
<p>In cases where anchors are used to match the widths or heights of widgets, it is convenient to use the <a href="qgraphicsanchorlayout.html#addAnchors">addAnchors</a>() function. As with the other functions for specifying anchors, it can also be used to anchor a widget to a layout.</p>
<br style="clear: both" /><a name="size-hints-and-size-policies-in-an-anchor-layout"></a>
<h3>Size Hints and Size Policies in an Anchor Layout</h3>
<p>QGraphicsAnchorLayout respects each item's size hints and size policies. Note that there are some properties of <a href="qsizepolicy.html">QSizePolicy</a> that are <a href="known-issues.html">not respected</a>.</p>
<a name="spacing-within-an-anchor-layout"></a>
<h3>Spacing within an Anchor Layout</h3>
<p>The layout may distribute some space between the items. If the spacing has not been explicitly specified, the actual amount of space will usually be 0.</p>
<p>However, if the first edge is the <i>opposite</i> of the second edge (e.g&#x2e;, the right edge of the first widget is anchored to the left edge of the second widget), the size of the anchor will be queried from the style through a pixel metric: <a href="qstyle.html#PixelMetric-enum">PM_LayoutHorizontalSpacing</a> for horizontal anchors and <a href="qstyle.html#PixelMetric-enum">PM_LayoutVerticalSpacing</a> for vertical anchors.</p>
<p>If the spacing is negative, the items will overlap to some extent.</p>
<a name="known-issues"></a>
<h3>Known issues</h3>
<p>There are some features that QGraphicsAnchorLayout currently does not support. This might change in the future, so avoid using these features if you want to avoid any future regressions in behaviour:</p>
<ul>
<li>Stretch factors are not respected.</li>
<li><a href="qsizepolicy.html#PolicyFlag-enum">QSizePolicy::ExpandFlag</a> is not respected.</li>
<li>Height for width is not respected.</li>
</ul>
</div>
<p><b>See also </b><a href="qgraphicslinearlayout.html">QGraphicsLinearLayout</a>, <a href="qgraphicsgridlayout.html">QGraphicsGridLayout</a>, and <a href="qgraphicslayout.html">QGraphicsLayout</a>.</p>
<!-- @@@QGraphicsAnchorLayout -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGraphicsAnchorLayout[overload1]$$$QGraphicsAnchorLayoutQGraphicsLayoutItem* -->
<h3 class="fn"><a name="QGraphicsAnchorLayout"></a>QGraphicsAnchorLayout::<span class="name">QGraphicsAnchorLayout</span> ( <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> instance. <i>parent</i> is passed to <a href="qgraphicslayout.html">QGraphicsLayout</a>'s constructor.</p>
<!-- @@@QGraphicsAnchorLayout -->
<!-- $$$~QGraphicsAnchorLayout[overload1]$$$~QGraphicsAnchorLayout -->
<h3 class="fn"><a name="dtor.QGraphicsAnchorLayout"></a>QGraphicsAnchorLayout::<span class="name">~QGraphicsAnchorLayout</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> object.</p>
<!-- @@@~QGraphicsAnchorLayout -->
<!-- $$$addAnchor[overload1]$$$addAnchorQGraphicsLayoutItem*Qt::AnchorPointQGraphicsLayoutItem*Qt::AnchorPoint -->
<h3 class="fn"><a name="addAnchor"></a><span class="type"><a href="qgraphicsanchor.html">QGraphicsAnchor</a></span> * QGraphicsAnchorLayout::<span class="name">addAnchor</span> ( <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>firstItem</i>, <span class="type"><a href="qt.html#AnchorPoint-enum">Qt::AnchorPoint</a></span> <i>firstEdge</i>, <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>secondItem</i>, <span class="type"><a href="qt.html#AnchorPoint-enum">Qt::AnchorPoint</a></span> <i>secondEdge</i> )</h3>
<p>Creates an anchor between the edge <i>firstEdge</i> of item <i>firstItem</i> and the edge <i>secondEdge</i> of item <i>secondItem</i>. The spacing of the anchor is picked up from the style. Anchors between a layout edge and an item edge will have a size of 0. If there is already an anchor between the edges, the the new anchor will replace the old one.</p>
<p><i>firstItem</i> and <i>secondItem</i> are automatically added to the layout if they are not part of the layout. This means that <a href="qgraphicsanchorlayout.html#count">count</a>() can increase by up to 2.</p>
<p>The spacing an anchor will get depends on the type of anchor. For instance, anchors from the Right edge of one item to the Left edge of another (or vice versa) will use the default horizontal spacing. The same behaviour applies to Bottom to Top anchors, (but they will use the default vertical spacing). For all other anchor combinations, the spacing will be 0. All anchoring functions will follow this rule.</p>
<p>The spacing can also be set manually by using <a href="qgraphicsanchor.html#spacing-prop">QGraphicsAnchor::setSpacing</a>() method.</p>
<p>Calling this function where <i>firstItem</i> or <i>secondItem</i> are ancestors of the layout have undefined behaviour.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#addAnchors">addAnchors</a>() and <a href="qgraphicsanchorlayout.html#addCornerAnchors">addCornerAnchors</a>().</p>
<!-- @@@addAnchor -->
<!-- $$$addAnchors[overload1]$$$addAnchorsQGraphicsLayoutItem*QGraphicsLayoutItem*Qt::Orientations -->
<h3 class="fn"><a name="addAnchors"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">addAnchors</span> ( <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>firstItem</i>, <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>secondItem</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientations</a></span> <i>orientations</i> = Qt::Horizontal | Qt::Vertical )</h3>
<p>Anchors two or four edges of <i>firstItem</i> with the corresponding edges of <i>secondItem</i>, so that <i>firstItem</i> has the same size as <i>secondItem</i> in the dimensions specified by <i>orientations</i>.</p>
<p>For example, the following example anchors the left and right edges of two items to match their widths:</p>
<pre class="cpp"> layout-&gt;addAnchor(b, Qt::AnchorLeft, c, Qt::AnchorLeft);
 layout-&gt;addAnchor(b, Qt::AnchorRight, c, Qt::AnchorRight);</pre>
<p>This can also be achieved using the following line of code:</p>
<pre class="cpp"> layout<span class="operator">-</span><span class="operator">&gt;</span>addAnchors(b<span class="operator">,</span> c<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>Horizontal);</pre>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#addAnchor">addAnchor</a>() and <a href="qgraphicsanchorlayout.html#addCornerAnchors">addCornerAnchors</a>().</p>
<!-- @@@addAnchors -->
<!-- $$$addCornerAnchors[overload1]$$$addCornerAnchorsQGraphicsLayoutItem*Qt::CornerQGraphicsLayoutItem*Qt::Corner -->
<h3 class="fn"><a name="addCornerAnchors"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">addCornerAnchors</span> ( <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>firstItem</i>, <span class="type"><a href="qt.html#Corner-enum">Qt::Corner</a></span> <i>firstCorner</i>, <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>secondItem</i>, <span class="type"><a href="qt.html#Corner-enum">Qt::Corner</a></span> <i>secondCorner</i> )</h3>
<p>Creates two anchors between <i>firstItem</i> and <i>secondItem</i> specified by the corners, <i>firstCorner</i> and <i>secondCorner</i>, where one is for the horizontal edge and another one for the vertical edge.</p>
<p>This is a convenience function, since anchoring corners can be expressed as anchoring two edges. For instance:</p>
<pre class="cpp"> layout-&gt;addAnchor(a, Qt::AnchorTop, layout, Qt::AnchorTop);
 layout-&gt;addAnchor(a, Qt::AnchorLeft, layout, Qt::AnchorLeft);</pre>
<p>This can also be achieved with the following line of code:</p>
<pre class="cpp"> layout<span class="operator">-</span><span class="operator">&gt;</span>addCornerAnchors(a<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>TopLeftCorner<span class="operator">,</span> layout<span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>TopLeftCorner);</pre>
<p>If there is already an anchor between the edge pairs, it will be replaced by the anchors that this function specifies.</p>
<p><i>firstItem</i> and <i>secondItem</i> are automatically added to the layout if they are not part of the layout. This means that <a href="qgraphicsanchorlayout.html#count">count</a>() can increase by up to 2.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#addAnchor">addAnchor</a>() and <a href="qgraphicsanchorlayout.html#addAnchors">addAnchors</a>().</p>
<!-- @@@addCornerAnchors -->
<!-- $$$anchor[overload1]$$$anchorQGraphicsLayoutItem*Qt::AnchorPointQGraphicsLayoutItem*Qt::AnchorPoint -->
<h3 class="fn"><a name="anchor"></a><span class="type"><a href="qgraphicsanchor.html">QGraphicsAnchor</a></span> * QGraphicsAnchorLayout::<span class="name">anchor</span> ( <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>firstItem</i>, <span class="type"><a href="qt.html#AnchorPoint-enum">Qt::AnchorPoint</a></span> <i>firstEdge</i>, <span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * <i>secondItem</i>, <span class="type"><a href="qt.html#AnchorPoint-enum">Qt::AnchorPoint</a></span> <i>secondEdge</i> )</h3>
<p>Returns the anchor between the anchor points defined by <i>firstItem</i> and <i>firstEdge</i> and <i>secondItem</i> and <i>secondEdge</i>. If there is no such anchor, the function will return 0.</p>
<!-- @@@anchor -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type">int</span> QGraphicsAnchorLayout::<span class="name">count</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayout.html#count">QGraphicsLayout::count</a>().</p>
<!-- @@@count -->
<!-- $$$horizontalSpacing[overload1]$$$horizontalSpacing -->
<h3 class="fn"><a name="horizontalSpacing"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsAnchorLayout::<span class="name">horizontalSpacing</span> () const</h3>
<p>Returns the default horizontal spacing for the anchor layout.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#verticalSpacing">verticalSpacing</a>() and <a href="qgraphicsanchorlayout.html#setHorizontalSpacing">setHorizontalSpacing</a>().</p>
<!-- @@@horizontalSpacing -->
<!-- $$$invalidate[overload1]$$$invalidate -->
<h3 class="fn"><a name="invalidate"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">invalidate</span> ()<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayout.html#invalidate">QGraphicsLayout::invalidate</a>().</p>
<!-- @@@invalidate -->
<!-- $$$itemAt[overload1]$$$itemAtint -->
<h3 class="fn"><a name="itemAt"></a><span class="type"><a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></span> * QGraphicsAnchorLayout::<span class="name">itemAt</span> ( <span class="type">int</span> <i>index</i> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayout.html#itemAt">QGraphicsLayout::itemAt</a>().</p>
<!-- @@@itemAt -->
<!-- $$$removeAt[overload1]$$$removeAtint -->
<h3 class="fn"><a name="removeAt"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">removeAt</span> ( <span class="type">int</span> <i>index</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayout.html#removeAt">QGraphicsLayout::removeAt</a>().</p>
<p>Removes the layout item at <i>index</i> without destroying it. Ownership of the item is transferred to the caller.</p>
<p>Removing an item will also remove any of the anchors associated with it.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#itemAt">itemAt</a>() and <a href="qgraphicsanchorlayout.html#count">count</a>().</p>
<!-- @@@removeAt -->
<!-- $$$setGeometry[overload1]$$$setGeometryconstQRectF& -->
<h3 class="fn"><a name="setGeometry"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setGeometry</span> ( const <span class="type"><a href="qrectf.html">QRectF</a></span> &amp; <i>geom</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#setGeometry">QGraphicsLayoutItem::setGeometry</a>().</p>
<!-- @@@setGeometry -->
<!-- $$$setHorizontalSpacing[overload1]$$$setHorizontalSpacingqreal -->
<h3 class="fn"><a name="setHorizontalSpacing"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setHorizontalSpacing</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>spacing</i> )</h3>
<p>Sets the default horizontal spacing for the anchor layout to <i>spacing</i>.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#horizontalSpacing">horizontalSpacing</a>(), <a href="qgraphicsanchorlayout.html#setVerticalSpacing">setVerticalSpacing</a>(), and <a href="qgraphicsanchorlayout.html#setSpacing">setSpacing</a>().</p>
<!-- @@@setHorizontalSpacing -->
<!-- $$$setSpacing[overload1]$$$setSpacingqreal -->
<h3 class="fn"><a name="setSpacing"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setSpacing</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>spacing</i> )</h3>
<p>Sets the default horizontal and the default vertical spacing for the anchor layout to <i>spacing</i>.</p>
<p>If an item is anchored with no spacing associated with the anchor, it will use the default spacing.</p>
<p><a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> does not support negative spacings. Setting a negative value will unset the previous spacing and make the layout use the spacing provided by the current widget style.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#setHorizontalSpacing">setHorizontalSpacing</a>() and <a href="qgraphicsanchorlayout.html#setVerticalSpacing">setVerticalSpacing</a>().</p>
<!-- @@@setSpacing -->
<!-- $$$setVerticalSpacing[overload1]$$$setVerticalSpacingqreal -->
<h3 class="fn"><a name="setVerticalSpacing"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setVerticalSpacing</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>spacing</i> )</h3>
<p>Sets the default vertical spacing for the anchor layout to <i>spacing</i>.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#verticalSpacing">verticalSpacing</a>(), <a href="qgraphicsanchorlayout.html#setHorizontalSpacing">setHorizontalSpacing</a>(), and <a href="qgraphicsanchorlayout.html#setSpacing">setSpacing</a>().</p>
<!-- @@@setVerticalSpacing -->
<!-- $$$sizeHint[overload1]$$$sizeHintQt::SizeHintconstQSizeF& -->
<h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsizef.html">QSizeF</a></span> QGraphicsAnchorLayout::<span class="name">sizeHint</span> ( <span class="type"><a href="qt.html#SizeHint-enum">Qt::SizeHint</a></span> <i>which</i>, const <span class="type"><a href="qsizef.html">QSizeF</a></span> &amp; <i>constraint</i> = QSizeF() ) const<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#sizeHint">QGraphicsLayoutItem::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$verticalSpacing[overload1]$$$verticalSpacing -->
<h3 class="fn"><a name="verticalSpacing"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsAnchorLayout::<span class="name">verticalSpacing</span> () const</h3>
<p>Returns the default vertical spacing for the anchor layout.</p>
<p><b>See also </b><a href="qgraphicsanchorlayout.html#horizontalSpacing">horizontalSpacing</a>() and <a href="qgraphicsanchorlayout.html#setVerticalSpacing">setVerticalSpacing</a>().</p>
<!-- @@@verticalSpacing -->
</div>
      </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>