123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <!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"/>
- <meta name="author" content="Emanuel Eichhammer" />
- <meta name="copyright" content="(C) 2013-2015 Emanuel Eichhammer" />
- <title>QCPItemAnchor Class Reference</title>
- <link href="qt.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <div id="top">
- <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> ·
- <a class="headerLink" href="pages.html">Special Pages</a>
- <!-- Generated by Doxygen 1.8.6 -->
- </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="node2" href="classQCPItemPosition.html" title="Manages the position of an item. " alt="" coords="5,77,120,101"/></map>
- </div>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><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="separator:aeb6b681d2bf324db40a915d32ec5624f"><td class="memSeparator" colspan="2"> </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="separator:ac93984042a58c875e76847dc3e5f75fe"><td class="memSeparator" colspan="2"> </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>
- <tr class="separator:ae92def8f9297c5d73f5806c586517bb3"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><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="separator:ac54b20120669950255a63587193dbb86"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:aef15daa640debfb11b0aeaa2116c6fbc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#aef15daa640debfb11b0aeaa2116c6fbc">addChildX</a> (<a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> *pos)</td></tr>
- <tr class="separator:aef15daa640debfb11b0aeaa2116c6fbc"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a230b1d494cda63458e289bbe1b642599"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#a230b1d494cda63458e289bbe1b642599">removeChildX</a> (<a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> *pos)</td></tr>
- <tr class="separator:a230b1d494cda63458e289bbe1b642599"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:af05dc56f24536f0c7a9a0f57b58cea67"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#af05dc56f24536f0c7a9a0f57b58cea67">addChildY</a> (<a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> *pos)</td></tr>
- <tr class="separator:af05dc56f24536f0c7a9a0f57b58cea67"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:aa2394911d8fff3bd958b9f4f1994b64d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPItemAnchor.html#aa2394911d8fff3bd958b9f4f1994b64d">removeChildY</a> (<a class="el" href="classQCPItemPosition.html">QCPItemPosition</a> *pos)</td></tr>
- <tr class="separator:aa2394911d8fff3bd958b9f4f1994b64d"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">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 class="groupheader">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 class="groupheader">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="aef15daa640debfb11b0aeaa2116c6fbc"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void QCPItemAnchor::addChildX </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 childX list of this anchor, which keeps track of which children use this anchor as parent anchor for the respective coordinate. 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="a230b1d494cda63458e289bbe1b642599"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void QCPItemAnchor::removeChildX </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 childX list of this anchor.</p>
- <p>Note that this function does not change the parent setting in <em>pos</em>. </p>
- </div>
- </div>
- <a class="anchor" id="af05dc56f24536f0c7a9a0f57b58cea67"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void QCPItemAnchor::addChildY </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 childY list of this anchor, which keeps track of which children use this anchor as parent anchor for the respective coordinate. 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="aa2394911d8fff3bd958b9f4f1994b64d"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void QCPItemAnchor::removeChildY </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 childY 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/item.h</li>
- <li>src/item.cpp</li>
- </ul>
- </div><!-- contents -->
- </body>
- </html>
|