Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3306

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgraphicsanchorlayout.cpp -->
  <title>QGraphicsAnchorLayout Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QGraphicsAnchorLayout</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented 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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGraphicsAnchorLayout Class</h1>
<!-- $$$QGraphicsAnchorLayout-brief -->
<p>The <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> class provides a layout where one can anchor widgets together in Graphics View. <a href="#details">More...</a></p>
<!-- @@@QGraphicsAnchorLayout -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGraphicsAnchorLayout&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.6</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qgraphicslayout.html">QGraphicsLayout</a></td></tr></table></div><ul>
<li><a href="qgraphicsanchorlayout-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><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> = Q_NULLPTR)</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></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><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></div>
<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 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><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></div>
<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>
<a name="details"></a>
<!-- $$$QGraphicsAnchorLayout-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> 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="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>AnchorLeft<span class="operator">,</span> a<span class="operator">,</span> <span class="type"><a href="../qtcore/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="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>AnchorTop<span class="operator">,</span> a<span class="operator">,</span> <span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>AnchorBottom);

</pre>
<p>Here, the right edge of item <code>a</code> is anchored to the left edge of item <code>b</code> and the bottom edge of item <code>a</code> is anchored to the top edge of item <code>b</code>, with the result that item <code>b</code> will be placed diagonally to the right and below item <code>b</code>.</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="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>TopLeftCorner<span class="operator">,</span> layout<span class="operator">,</span> <span class="type"><a href="../qtcore/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>
<a name="size-hints-and-size-policies-in-an-anchor-layout"></a>
<h3 >Size Hints and Size Policies in an Anchor Layout</h3>
<p><a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> 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="qgraphicsanchorlayout.html#known-issues">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 <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> 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="graphicsview.html#qgraphicslayout">QGraphicsLayout</a>.</p>
<!-- @@@QGraphicsAnchorLayout -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGraphicsAnchorLayout[overload1]$$$QGraphicsAnchorLayoutQGraphicsLayoutItem* -->
<h3 class="fn" id="QGraphicsAnchorLayout"><a name="QGraphicsAnchorLayout"></a>QGraphicsAnchorLayout::<span class="name">QGraphicsAnchorLayout</span>(<span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> instance. <i>parent</i> is passed to <a href="graphicsview.html#qgraphicslayout">QGraphicsLayout</a>'s constructor.</p>
<!-- @@@QGraphicsAnchorLayout -->
<!-- $$$~QGraphicsAnchorLayout[overload1]$$$~QGraphicsAnchorLayout -->
<h3 class="fn" id="dtor.QGraphicsAnchorLayout"><a name="dtor.QGraphicsAnchorLayout"></a><code>[virtual] </code>QGraphicsAnchorLayout::<span class="name">~QGraphicsAnchorLayout</span>()</h3>
<p>Destroys the <a href="qgraphicsanchorlayout.html">QGraphicsAnchorLayout</a> object.</p>
<!-- @@@~QGraphicsAnchorLayout -->
<!-- $$$addAnchor[overload1]$$$addAnchorQGraphicsLayoutItem*Qt::AnchorPointQGraphicsLayoutItem*Qt::AnchorPoint -->
<h3 class="fn" id="addAnchor"><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">QGraphicsLayoutItem</a></span> *<i>firstItem</i>, <span class="type"><a href="../qtcore/qt.html#AnchorPoint-enum">Qt::AnchorPoint</a></span> <i>firstEdge</i>, <span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>secondItem</i>, <span class="type"><a href="../qtcore/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 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" id="addAnchors"><a name="addAnchors"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">addAnchors</span>(<span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>firstItem</i>, <span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>secondItem</i>, <span class="type"><a href="../qtcore/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="../qtcore/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" id="addCornerAnchors"><a name="addCornerAnchors"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">addCornerAnchors</span>(<span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>firstItem</i>, <span class="type"><a href="../qtcore/qt.html#Corner-enum">Qt::Corner</a></span> <i>firstCorner</i>, <span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>secondItem</i>, <span class="type"><a href="../qtcore/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="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>TopLeftCorner<span class="operator">,</span> layout<span class="operator">,</span> <span class="type"><a href="../qtcore/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" id="anchor"><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">QGraphicsLayoutItem</a></span> *<i>firstItem</i>, <span class="type"><a href="../qtcore/qt.html#AnchorPoint-enum">Qt::AnchorPoint</a></span> <i>firstEdge</i>, <span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *<i>secondItem</i>, <span class="type"><a href="../qtcore/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" id="count"><a name="count"></a><code>[virtual] </code><span class="type">int</span> QGraphicsAnchorLayout::<span class="name">count</span>() const</h3>
<p>Reimplemented from <a href="qgraphicslayout.html#count">QGraphicsLayout::count</a>().</p>
<!-- @@@count -->
<!-- $$$horizontalSpacing[overload1]$$$horizontalSpacing -->
<h3 class="fn" id="horizontalSpacing"><a name="horizontalSpacing"></a><span class="type"><a href="../qtcore/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" id="invalidate"><a name="invalidate"></a><code>[virtual] </code><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">invalidate</span>()</h3>
<p>Reimplemented from <a href="qgraphicslayout.html#invalidate">QGraphicsLayout::invalidate</a>().</p>
<!-- @@@invalidate -->
<!-- $$$itemAt[overload1]$$$itemAtint -->
<h3 class="fn" id="itemAt"><a name="itemAt"></a><code>[virtual] </code><span class="type"><a href="qgraphicslayoutitem.html#QGraphicsLayoutItem">QGraphicsLayoutItem</a></span> *QGraphicsAnchorLayout::<span class="name">itemAt</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Reimplemented from <a href="qgraphicslayout.html#itemAt">QGraphicsLayout::itemAt</a>().</p>
<!-- @@@itemAt -->
<!-- $$$removeAt[overload1]$$$removeAtint -->
<h3 class="fn" id="removeAt"><a name="removeAt"></a><code>[virtual] </code><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">removeAt</span>(<span class="type">int</span> <i>index</i>)</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" id="setGeometry"><a name="setGeometry"></a><code>[virtual] </code><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setGeometry</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>geom</i>)</h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#setGeometry">QGraphicsLayoutItem::setGeometry</a>().</p>
<!-- @@@setGeometry -->
<!-- $$$setHorizontalSpacing[overload1]$$$setHorizontalSpacingqreal -->
<h3 class="fn" id="setHorizontalSpacing"><a name="setHorizontalSpacing"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setHorizontalSpacing</span>(<span class="type"><a href="../qtcore/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" id="setSpacing"><a name="setSpacing"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setSpacing</span>(<span class="type"><a href="../qtcore/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" id="setVerticalSpacing"><a name="setVerticalSpacing"></a><span class="type">void</span> QGraphicsAnchorLayout::<span class="name">setVerticalSpacing</span>(<span class="type"><a href="../qtcore/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" id="sizeHint"><a name="sizeHint"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span> QGraphicsAnchorLayout::<span class="name">sizeHint</span>(<span class="type"><a href="../qtcore/qt.html#SizeHint-enum">Qt::SizeHint</a></span> <i>which</i>, const <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span> &amp;<i>constraint</i> = QSizeF()) const</h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#sizeHint">QGraphicsLayoutItem::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$verticalSpacing[overload1]$$$verticalSpacing -->
<h3 class="fn" id="verticalSpacing"><a name="verticalSpacing"></a><span class="type"><a href="../qtcore/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>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>