1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
|
<?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/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<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>
<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 <QGraphicsAnchorLayout></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 & <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 & <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 "center" is also considered to be an edge. Consider the following example:</p>
<pre class="cpp"> layout<span class="operator">-</span><span class="operator">></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">></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">></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., 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->addAnchor(b, Qt::AnchorLeft, c, Qt::AnchorLeft);
layout->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">></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->addAnchor(a, Qt::AnchorTop, layout, Qt::AnchorTop);
layout->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">></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> & <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> & <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 class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation 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>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
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>
</body>
</html>
|