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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QCPItemAnchor Class Reference</title>
<link href="qt.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class=header>
<a class=headerLink href="index.html">Main Page</a> ·
<a class=headerLink href="classoverview.html">Class Overview</a> ·
<a class=headerLink href="hierarchy.html">Hierarchy</a> ·
<a class=headerLink href="annotated.html">All Classes</a>
</div>
<!-- Generated by Doxygen 1.8.1.2 -->
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Functions</a> |
<a href="#pro-methods">Protected Functions</a> </div>
<div class="headertitle">
<div class="title">QCPItemAnchor Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>An anchor of an item to which positions can be attached to.
<a href="classQCPItemAnchor.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for QCPItemAnchor:</div>
<div class="dyncontent">
<div class="center"><img src="classQCPItemAnchor__inherit__graph.png" border="0" usemap="#QCPItemAnchor_inherit__map" alt="Inheritance graph"/></div>
<map name="QCPItemAnchor_inherit__map" id="QCPItemAnchor_inherit__map">
<area shape="rect" id="node3" href="classQCPItemPosition.html" title="Manages the position of an item." alt="" coords="5,81,120,106"/></map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Functions</h2></td></tr>
<tr class="memitem:aeb6b681d2bf324db40a915d32ec5624f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#aeb6b681d2bf324db40a915d32ec5624f">QCPItemAnchor</a> (<a class="el" href="classQCustomPlot.html">QCustomPlot</a> *parentPlot, <a class="el" href="classQCPAbstractItem.html">QCPAbstractItem</a> *parentItem, const QString name, int anchorId=-1)</td></tr>
<tr class="memitem:ac93984042a58c875e76847dc3e5f75fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac93984042a58c875e76847dc3e5f75fe"></a>
QString </td><td class="memItemRight" valign="bottom"><b>name</b> () const </td></tr>
<tr class="memitem:ae92def8f9297c5d73f5806c586517bb3"><td class="memItemLeft" align="right" valign="top">virtual QPointF </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#ae92def8f9297c5d73f5806c586517bb3">pixelPoint</a> () const </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected Functions</h2></td></tr>
<tr class="memitem:ac54b20120669950255a63587193dbb86"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#ac54b20120669950255a63587193dbb86">toQCPItemPosition</a> ()</td></tr>
<tr class="memitem:ad11517e2ce5c2f9a798e78fb45e2e0d0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#ad11517e2ce5c2f9a798e78fb45e2e0d0">addChild</a> (<a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> *pos)</td></tr>
<tr class="memitem:ab65ec61984575f737f43c2bb59dd0d76"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#ab65ec61984575f737f43c2bb59dd0d76">removeChild</a> (<a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> *pos)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An anchor of an item to which positions can be attached to. </p>
<p>An item (<a class="el" href="classQCPAbstractItem.html" title="The abstract base class for all items in a plot.">QCPAbstractItem</a>) may have one or more anchors. Unlike <a class="el" href="classQCPItemPosition.html" title="Manages the position of an item.">QCPItemPosition</a>, an anchor doesn't control anything on its item, but provides a way to tie other items via their positions to the anchor.</p>
<p>For example, a <a class="el" href="classQCPItemRect.html" title="A rectangle.">QCPItemRect</a> is defined by its positions <em>topLeft</em> and <em>bottomRight</em>. Additionally it has various anchors like <em>top</em>, <em>topRight</em> or <em>bottomLeft</em> etc. So you can attach the <em>start</em> (which is a <a class="el" href="classQCPItemPosition.html" title="Manages the position of an item.">QCPItemPosition</a>) of a <a class="el" href="classQCPItemLine.html" title="A line from one point to another.">QCPItemLine</a> to one of the anchors by calling <a class="el" href="classQCPItemPosition.html#ac094d67a95d2dceafa0d50b9db3a7e51">QCPItemPosition::setParentAnchor</a> on <em>start</em>, passing the wanted anchor of the <a class="el" href="classQCPItemRect.html" title="A rectangle.">QCPItemRect</a>. This way the start of the line will now always follow the respective anchor location on the rect item.</p>
<p>Note that <a class="el" href="classQCPItemPosition.html" title="Manages the position of an item.">QCPItemPosition</a> derives from <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a>, so every position can also serve as an anchor to other positions.</p>
<p>To learn how to provide anchors in your own item subclasses, see the subclassing section of the <a class="el" href="classQCPAbstractItem.html" title="The abstract base class for all items in a plot.">QCPAbstractItem</a> documentation. </p>
</div><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="aeb6b681d2bf324db40a915d32ec5624f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">QCPItemAnchor::QCPItemAnchor </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCustomPlot.html">QCustomPlot</a> * </td>
<td class="paramname"><em>parentPlot</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classQCPAbstractItem.html">QCPAbstractItem</a> * </td>
<td class="paramname"><em>parentItem</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const QString </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>anchorId</em> = <code>-1</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a>. You shouldn't create <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a> instances directly, even if you want to make a new item subclass. Use <a class="el" href="classQCPAbstractItem.html#af3fc92527802078ca395138748b629a7">QCPAbstractItem::createAnchor</a> instead, as explained in the subclassing section of the <a class="el" href="classQCPAbstractItem.html" title="The abstract base class for all items in a plot.">QCPAbstractItem</a> documentation. </p>
</div>
</div>
<h2>Member Function Documentation</h2>
<a class="anchor" id="ae92def8f9297c5d73f5806c586517bb3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">QPointF QCPItemAnchor::pixelPoint </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the final absolute pixel position of the <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a> on the <a class="el" href="classQCustomPlot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> surface.</p>
<p>The pixel information is internally retrieved via QCPAbstractItem::anchorPixelPosition of the parent item, <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a> is just an intermediary. </p>
<p>Reimplemented in <a class="el" href="classQCPItemPosition.html#ae490f9c76ee2ba33752c495d3b6e8fb5">QCPItemPosition</a>.</p>
</div>
</div>
<a class="anchor" id="ac54b20120669950255a63587193dbb86"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> * QCPItemAnchor::toQCPItemPosition </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns 0 if this instance is merely a <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a>, and a valid pointer of type QCPItemPosition* if it actually is a <a class="el" href="classQCPItemPosition.html" title="Manages the position of an item.">QCPItemPosition</a> (which is a subclass of <a class="el" href="classQCPItemAnchor.html" title="An anchor of an item to which positions can be attached to.">QCPItemAnchor</a>).</p>
<p>This safe downcast functionality could also be achieved with a dynamic_cast. However, <a class="el" href="classQCustomPlot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> avoids dynamic_cast to work with projects that don't have RTTI support enabled (e.g. -fno-rtti flag with gcc compiler). </p>
<p>Reimplemented in <a class="el" href="classQCPItemPosition.html#a577a7efc601df85a20b3e709d1ac320e">QCPItemPosition</a>.</p>
</div>
</div>
<a class="anchor" id="ad11517e2ce5c2f9a798e78fb45e2e0d0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void QCPItemAnchor::addChild </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> * </td>
<td class="paramname"><em>pos</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds <em>pos</em> to the child list of this anchor. This is necessary to notify the children prior to destruction of the anchor.</p>
<p>Note that this function does not change the parent setting in <em>pos</em>. </p>
</div>
</div>
<a class="anchor" id="ab65ec61984575f737f43c2bb59dd0d76"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void QCPItemAnchor::removeChild </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> * </td>
<td class="paramname"><em>pos</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes <em>pos</em> from the child list of this anchor.</p>
<p>Note that this function does not change the parent setting in <em>pos</em>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="item_8h_source.html">item.h</a></li>
<li>src/item.cpp</li>
</ul>
</div><!-- contents -->
<div class="footer" />Generated with <a href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.1.2</div>
</body>
</html>
|