📄 class_qwt_plot_zoomer.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Qwt User's Guide: QwtPlotZoomer Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.6 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li id="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul></div><h1>QwtPlotZoomer Class Reference</h1><!-- doxytag: class="QwtPlotZoomer" --><!-- doxytag: inherits="QwtPlotPicker" -->Inheritance diagram for QwtPlotZoomer:<p><center><img src="class_qwt_plot_zoomer__inherit__graph.png" border="0" usemap="#_qwt_plot_zoomer__inherit__map" alt="Inheritance graph"></center><map name="_qwt_plot_zoomer__inherit__map"><area href="class_qwt_plot_picker.html" shape="rect" coords="16,157,120,181" alt=""><area href="class_qwt_picker.html" shape="rect" coords="27,83,109,107" alt=""><area href="class_qwt_event_pattern.html" shape="rect" coords="7,8,129,32" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for QwtPlotZoomer:<p><center><img src="class_qwt_plot_zoomer__coll__graph.png" border="0" usemap="#_qwt_plot_zoomer__coll__map" alt="Collaboration graph"></center><map name="_qwt_plot_zoomer__coll__map"><area href="class_qwt_plot_picker.html" shape="rect" coords="16,157,120,181" alt=""><area href="class_qwt_picker.html" shape="rect" coords="27,83,109,107" alt=""><area href="class_qwt_event_pattern.html" shape="rect" coords="7,8,129,32" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_qwt_plot_zoomer-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2><a class="el" href="class_qwt_plot_zoomer.html">QwtPlotZoomer</a> provides stacked zooming for a plot widget. <p><a class="el" href="class_qwt_plot_zoomer.html">QwtPlotZoomer</a> offers rubberband selections on the plot canvas, translating the selected rectangles into plot coordinates and adjusting the axes to them. Zooming can repeated as often as possible, limited only by <a class="el" href="class_qwt_plot_zoomer.html#c0d39d53af224cbeda37e0417d084dab">maxStackDepth()</a> or <a class="el" href="class_qwt_plot_zoomer.html#e25e8193ae6ad9c1e244f175db173836">minZoomSize()</a>. Each rectangle is pushed on a stack.<p>Zoom rectangles can be selected depending on <a class="el" href="class_qwt_picker.html#d8e6fc50cd841e543a359c099024c448">selectionFlags()</a> using the mouse or keyboard (<a class="el" href="class_qwt_event_pattern.html">QwtEventPattern</a>, <a class="el" href="class_qwt_picker_machine.html">QwtPickerMachine</a>). QwtEventPattern::MouseSelect3/QwtEventPatternKeyUndo, or QwtEventPattern::MouseSelect6/QwtEventPatternKeyRedo walk up and down the zoom stack. QwtEventPattern::MouseSelect2 or QwtEventPattern::KeyHome unzoom to the initial size.<p><a class="el" href="class_qwt_plot_zoomer.html">QwtPlotZoomer</a> is tailored for plots with one x and y axis, but it is allowed to attach a second <a class="el" href="class_qwt_plot_zoomer.html">QwtPlotZoomer</a> for the other axes.<p><dl compact><dt><b>Note:</b></dt><dd>The realtime example includes an derived zoomer class that adds scrollbars to the plot canvas. </dd></dl><p><p>Definition at line <a class="el" href="qwt__plot__zoomer_8h-source.html#l00049">49</a> of file <a class="el" href="qwt__plot__zoomer_8h-source.html">qwt_plot_zoomer.h</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Slots</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#c66b3eac03db212812198637f4e233ca">moveBy</a> (double x, double y)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#6bfbb67129b1220df65685858c9d882c">move</a> (double x, double y)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#eeed51dfa01136f00961e679dcbb9d9d">zoom</a> (const QwtDoubleRect &)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#0cee73f15c5791553cb52c4e7b3e881e">zoom</a> (int up)</td></tr><tr><td colspan="2"><br><h2>Signals</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#e4e9b90ccfb97f4eae54c667f79644ff">zoomed</a> (const QwtDoubleRect &rect)</td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#07f5135e421d2aab3f06542ff1320ece">QwtPlotZoomer</a> (<a class="el" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *, bool doReplot=true)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#b64adf928b11ec8f441098a551e437b4">QwtPlotZoomer</a> (int xAxis, int yAxis, <a class="el" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *, bool doReplot=true)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#c94a73ec32fcfee08edf14d1a3021cd5">QwtPlotZoomer</a> (int xAxis, int yAxis, int selectionFlags, <a class="el" href="class_qwt_picker.html#01be4d404ffc3a7b238b0d0aaeb66b93">DisplayMode</a> trackerMode, <a class="el" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *, bool doReplot=true)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3af28fe93e0098ce8d09222a7976f254"></a><!-- doxytag: member="QwtPlotZoomer::~QwtPlotZoomer" ref="3af28fe93e0098ce8d09222a7976f254" args="()" -->virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#3af28fe93e0098ce8d09222a7976f254">~QwtPlotZoomer</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#7a1711597f441223efdb7d9931fe19b9">setZoomBase</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#80e1f91cf51b88aa11f2d976f01b4a3f">setZoomBase</a> (const QwtDoubleRect &)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">QwtDoubleRect </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#ec745fbace2e6d1e69e7d9be0368bd8e">zoomBase</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">QwtDoubleRect </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#ef67ca3d673cbd6063f0574621c808ae">zoomRect</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#6cb755e06b83e50e8353dd706f7fb6f0">setAxis</a> (int xAxis, int yAxis)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#3965591944793790407ba91d6de3a882">setMaxStackDepth</a> (int)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#c0d39d53af224cbeda37e0417d084dab">maxStackDepth</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const QStack< QwtDoubleRect > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#bbd7fe8750c177a82f80ea91611909fd">zoomStack</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#63797aa3b9e540a2c5f539fa34a05fbc">zoomRectIndex</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#c9d52dbddc9e79e7ce8ebd545e855e89">setSelectionFlags</a> (int)</td></tr><tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#0d0f90bbd5fe99d5231b3cee00fffabe">rescale</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual QwtDoubleSize </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#e25e8193ae6ad9c1e244f175db173836">minZoomSize</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#abded662ecb3555b3a29cf3daacf79de">widgetMouseReleaseEvent</a> (QMouseEvent *)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#a44e42dcf37547a6b93d04a593f140c6">widgetKeyPressEvent</a> (QKeyEvent *)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#a54bb05797c0468c0f8de4217dce24dd">begin</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#c7d10eb27858ccfebebecab5d69ecbb3">end</a> (bool ok=true)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_zoomer.html#86898c6696ee0706a3ac6b61018a112e">accept</a> (QwtPolygon &) const </td></tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="07f5135e421d2aab3f06542ff1320ece"></a><!-- doxytag: member="QwtPlotZoomer::QwtPlotZoomer" ref="07f5135e421d2aab3f06542ff1320ece" args="(QwtPlotCanvas *, bool doReplot=true)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtPlotZoomer::QwtPlotZoomer </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> * </td> <td class="mdname" nowrap> <em>canvas</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>doReplot</em> = <code>true</code></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [explicit]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Create a zoomer for a plot canvas. <p>The zoomer is set to those x- and y-axis of the parent plot of the canvas that are enabled. If both or no x-axis are enabled, the picker is set to QwtPlot::xBottom. If both or no y-axis are enabled, it is set to QwtPlot::yLeft.<p>The <a class="el" href="class_qwt_picker.html#d8e6fc50cd841e543a359c099024c448">selectionFlags()</a> are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>canvas</em> </td><td>Plot canvas to observe, also the parent object </td></tr> <tr><td valign="top"></td><td valign="top"><em>doReplot</em> </td><td>Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.</td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot.html#f14053ca41be0f9c6f820ed3c4379831">QwtPlot::autoReplot()</a>, <a class="el" href="class_qwt_plot.html#7b094e29b8e92b00e36517d0d7633c4b">QwtPlot::replot()</a>, QwtPlotPicker::setZoomBase() </dd></dl><p>Definition at line <a class="el" href="qwt__plot__zoomer_8cpp-source.html#l00051">51</a> of file <a class="el" href="qwt__plot__zoomer_8cpp-source.html">qwt_plot_zoomer.cpp</a>.<p>References <a class="el" href="qwt__plot__picker_8cpp-source.html#l00103">QwtPlotPicker::canvas()</a>. </td> </tr></table><a class="anchor" name="b64adf928b11ec8f441098a551e437b4"></a><!-- doxytag: member="QwtPlotZoomer::QwtPlotZoomer" ref="b64adf928b11ec8f441098a551e437b4" args="(int xAxis, int yAxis, QwtPlotCanvas *, bool doReplot=true)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtPlotZoomer::QwtPlotZoomer </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname" nowrap> <em>xAxis</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>yAxis</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> * </td> <td class="mdname" nowrap> <em>canvas</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>doReplot</em> = <code>true</code></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [explicit]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Create a zoomer for a plot canvas. <p>The <a class="el" href="class_qwt_picker.html#d8e6fc50cd841e543a359c099024c448">selectionFlags()</a> are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>xAxis</em> </td><td>X axis of the zoomer </td></tr> <tr><td valign="top"></td><td valign="top"><em>yAxis</em> </td><td>Y axis of the zoomer </td></tr> <tr><td valign="top"></td><td valign="top"><em>canvas</em> </td><td>Plot canvas to observe, also the parent object </td></tr> <tr><td valign="top"></td><td valign="top"><em>doReplot</em> </td><td>Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.</td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot.html#f14053ca41be0f9c6f820ed3c4379831">QwtPlot::autoReplot()</a>, <a class="el" href="class_qwt_plot.html#7b094e29b8e92b00e36517d0d7633c4b">QwtPlot::replot()</a>, QwtPlotPicker::setZoomBase() </dd></dl><p>Definition at line <a class="el" href="qwt__plot__zoomer_8cpp-source.html#l00075">75</a> of file <a class="el" href="qwt__plot__zoomer_8cpp-source.html">qwt_plot_zoomer.cpp</a>.<p>References <a class="el" href="qwt__plot__picker_8cpp-source.html#l00103">QwtPlotPicker::canvas()</a>. </td> </tr></table><a class="anchor" name="c94a73ec32fcfee08edf14d1a3021cd5"></a><!-- doxytag: member="QwtPlotZoomer::QwtPlotZoomer" ref="c94a73ec32fcfee08edf14d1a3021cd5" args="(int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *, bool doReplot=true)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtPlotZoomer::QwtPlotZoomer </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -