www.pudn.com > QCustomPlot---v1.0.zip > classQCPItemAnchor.html, change:2013-08-02,size:11344b


<!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:a688325bfb121b71b7c8260a6aec6d67f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a688325bfb121b71b7c8260a6aec6d67f"></a>
virtual <a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> * </td><td class="memItemRight" valign="bottom"><b>toQCPItemPosition</b> ()</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="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>