⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qwt__plot_8cpp-source.html

📁 QWT5.01用于Qt开发的二维图形库程序
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00690"></a>00690 <a name="l00695"></a><a class="code" href="class_qwt_plot.html#546ff473d973512141cc974e3609ad14">00695</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#546ff473d973512141cc974e3609ad14">QwtPlot::margin</a>()<span class="keyword"> const</span><a name="l00696"></a>00696 <span class="keyword"></span>{<a name="l00697"></a>00697     <span class="keywordflow">return</span> d_data-&gt;layout-&gt;margin();<a name="l00698"></a>00698 }<a name="l00699"></a>00699 <a name="l00708"></a><a class="code" href="class_qwt_plot.html#1a56902d2109fcf709ad1dbd35f0b859">00708</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#1a56902d2109fcf709ad1dbd35f0b859">QwtPlot::setCanvasBackground</a>(<span class="keyword">const</span> QColor &amp;c)<a name="l00709"></a>00709 {<a name="l00710"></a>00710     QPalette p = d_data-&gt;canvas-&gt;palette();<a name="l00711"></a>00711 <a name="l00712"></a>00712     <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; QPalette::NColorGroups; i++ )<a name="l00713"></a>00713     {<a name="l00714"></a>00714 #<span class="keywordflow">if</span> QT_VERSION &lt; 0x040000<a name="l00715"></a>00715         p.setColor((QPalette::ColorGroup)i, QColorGroup::Background, c);<a name="l00716"></a>00716 <span class="preprocessor">#else</span><a name="l00717"></a>00717 <span class="preprocessor"></span>        p.setColor((QPalette::ColorGroup)i, QPalette::Background, c);<a name="l00718"></a>00718 <span class="preprocessor">#endif</span><a name="l00719"></a>00719 <span class="preprocessor"></span>    }<a name="l00720"></a>00720 <a name="l00721"></a>00721     canvas()-&gt;setPalette(p);<a name="l00722"></a>00722 }<a name="l00723"></a>00723 <a name="l00730"></a><a class="code" href="class_qwt_plot.html#99109068ad7749dfe28074abe3cc49af">00730</a> <span class="keyword">const</span> QColor &amp; <a class="code" href="class_qwt_plot.html#99109068ad7749dfe28074abe3cc49af">QwtPlot::canvasBackground</a>()<span class="keyword"> const</span><a name="l00731"></a>00731 <span class="keyword"></span>{<a name="l00732"></a>00732 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span><a name="l00733"></a>00733 <span class="preprocessor"></span>    <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;palette().color(<a name="l00734"></a>00734         QPalette::Normal, QColorGroup::Background);<a name="l00735"></a>00735 <span class="preprocessor">#else</span><a name="l00736"></a>00736 <span class="preprocessor"></span>    <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;palette().color(<a name="l00737"></a>00737         QPalette::Normal, QPalette::Background);<a name="l00738"></a>00738 <span class="preprocessor">#endif</span><a name="l00739"></a>00739 <span class="preprocessor"></span>}<a name="l00740"></a>00740 <a name="l00747"></a><a class="code" href="class_qwt_plot.html#5af96e90be286753d524bdb042917618">00747</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#5af96e90be286753d524bdb042917618">QwtPlot::setCanvasLineWidth</a>(<span class="keywordtype">int</span> w)<a name="l00748"></a>00748 {<a name="l00749"></a>00749     <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;setLineWidth(w);<a name="l00750"></a>00750     <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();<a name="l00751"></a>00751 }<a name="l00752"></a>00752  <a name="l00758"></a><a class="code" href="class_qwt_plot.html#200c23f4574d857afc3f457999fcd0ce">00758</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#200c23f4574d857afc3f457999fcd0ce">QwtPlot::canvasLineWidth</a>()<span class="keyword"> const</span><a name="l00759"></a>00759 <span class="keyword"></span>{ <a name="l00760"></a>00760     <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;lineWidth();<a name="l00761"></a>00761 }<a name="l00762"></a>00762 <a name="l00767"></a><a class="code" href="class_qwt_plot.html#c02c033b024a4ecbefcf1b0e93c91205">00767</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#c02c033b024a4ecbefcf1b0e93c91205">QwtPlot::axisValid</a>(<span class="keywordtype">int</span> axisId)<a name="l00768"></a>00768 {<a name="l00769"></a>00769     <span class="keywordflow">return</span> ((axisId &gt;= QwtPlot::yLeft) &amp;&amp; (axisId &lt; QwtPlot::axisCnt));<a name="l00770"></a>00770 }<a name="l00771"></a>00771 <a name="l00777"></a><a class="code" href="class_qwt_plot.html#e1b53fe373a12b1558fca37fdc2f0a54">00777</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#e1b53fe373a12b1558fca37fdc2f0a54">QwtPlot::legendItemClicked</a>()<a name="l00778"></a>00778 {<a name="l00779"></a>00779     <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; sender()-&gt;isWidgetType() )<a name="l00780"></a>00780     {<a name="l00781"></a>00781         <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a> *plotItem = d_data-&gt;legend-&gt;find((QWidget *)sender());<a name="l00782"></a>00782         <span class="keywordflow">if</span> ( plotItem )<a name="l00783"></a>00783             emit <a class="code" href="class_qwt_plot.html#52b75d5548fbe04539b6297de53a2222">legendClicked</a>(plotItem);<a name="l00784"></a>00784     }<a name="l00785"></a>00785 }<a name="l00786"></a>00786 <a name="l00787"></a><a class="code" href="class_qwt_plot.html#d41768a65a7cc426091c89d54e3c2ab2">00787</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#d41768a65a7cc426091c89d54e3c2ab2">QwtPlot::legendItemChecked</a>(<span class="keywordtype">bool</span> on)<a name="l00788"></a>00788 {<a name="l00789"></a>00789     <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; sender()-&gt;isWidgetType() )<a name="l00790"></a>00790     {<a name="l00791"></a>00791         <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a> *plotItem = d_data-&gt;legend-&gt;find((QWidget *)sender());<a name="l00792"></a>00792         <span class="keywordflow">if</span> ( plotItem )<a name="l00793"></a>00793             emit <a class="code" href="class_qwt_plot.html#bd9e17629dd7c142fed017ea5e347149">legendChecked</a>(plotItem, on);<a name="l00794"></a>00794     }<a name="l00795"></a>00795 }<a name="l00796"></a>00796 <a name="l00798"></a><a class="code" href="class_qwt_plot.html#e2191d8ad33164b83aa2a14563f132a5">00798</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#e2191d8ad33164b83aa2a14563f132a5">QwtPlot::clear</a>()<a name="l00799"></a>00799 {<a name="l00800"></a>00800     <a class="code" href="class_qwt_plot_dict.html#cb2e402e05c693433ed7e84696fbdfc0">detachItems</a>(QwtPlotItem::Rtti_PlotCurve);<a name="l00801"></a>00801     <a class="code" href="class_qwt_plot_dict.html#cb2e402e05c693433ed7e84696fbdfc0">detachItems</a>(QwtPlotItem::Rtti_PlotMarker);<a name="l00802"></a>00802 }<a name="l00803"></a>00803 <a name="l00830"></a><a class="code" href="class_qwt_plot.html#6e23cad2bce7b04a09f18fa139341d5c">00830</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#6e23cad2bce7b04a09f18fa139341d5c">QwtPlot::insertLegend</a>(<a class="code" href="class_qwt_legend.html">QwtLegend</a> *legend, <a name="l00831"></a>00831     <a class="code" href="class_qwt_plot.html#31aacb65b5c049dde8c34a0d8482661b">QwtPlot::LegendPosition</a> pos, <span class="keywordtype">double</span> ratio)<a name="l00832"></a>00832 {<a name="l00833"></a>00833     d_data-&gt;layout-&gt;setLegendPosition(pos, ratio);<a name="l00834"></a>00834 <a name="l00835"></a>00835     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">legend</a> != d_data-&gt;legend )<a name="l00836"></a>00836     {<a name="l00837"></a>00837         <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; d_data-&gt;legend-&gt;parent() == this )<a name="l00838"></a>00838             <span class="keyword">delete</span> d_data-&gt;legend;<a name="l00839"></a>00839 <a name="l00840"></a>00840         d_data-&gt;legend = <a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">legend</a>;<a name="l00841"></a>00841 <a name="l00842"></a>00842         if ( d_data-&gt;legend )<a name="l00843"></a>00843         {<a name="l00844"></a>00844             <span class="keywordflow">if</span> ( pos != ExternalLegend )<a name="l00845"></a>00845             {<a name="l00846"></a>00846                 <span class="keywordflow">if</span> ( d_data-&gt;legend-&gt;parent() != this )<a name="l00847"></a>00847                 {<a name="l00848"></a>00848 #<span class="keywordflow">if</span> QT_VERSION &lt; 0x040000<a name="l00849"></a>00849                     d_data-&gt;legend-&gt;reparent(<span class="keyword">this</span>, QPoint(0, 0));<a name="l00850"></a>00850 <span class="preprocessor">#else</span><a name="l00851"></a>00851 <span class="preprocessor"></span>                    d_data-&gt;legend-&gt;setParent(<span class="keyword">this</span>);<a name="l00852"></a>00852 <span class="preprocessor">#endif</span><a name="l00853"></a>00853 <span class="preprocessor"></span>                }<a name="l00854"></a>00854             }<a name="l00855"></a>00855 <a name="l00856"></a>00856             <span class="keyword">const</span> QwtPlotItemList&amp; itmList = <a class="code" href="class_qwt_plot_dict.html#9cbb1c5c22de93594b7e2524af108f55">itemList</a>();<a name="l00857"></a>00857             <span class="keywordflow">for</span> ( QwtPlotItemIterator it = itmList.begin();<a name="l00858"></a>00858                 it != itmList.end(); ++it )<a name="l00859"></a>00859             {<a name="l00860"></a>00860                 (*it)-&gt;updateLegend(d_data-&gt;legend);<a name="l00861"></a>00861             }<a name="l00862"></a>00862 <a name="l00863"></a>00863             QLayout *l = d_data-&gt;legend-&gt;contentsWidget()-&gt;layout();<a name="l00864"></a>00864             <span class="keywordflow">if</span> ( l &amp;&amp; l-&gt;inherits(<span class="stringliteral">"QwtDynGridLayout"</span>) )<a name="l00865"></a>00865             {<a name="l00866"></a>00866                 <a class="code" href="class_qwt_dyn_grid_layout.html">QwtDynGridLayout</a> *tl = (<a class="code" href="class_qwt_dyn_grid_layout.html">QwtDynGridLayout</a> *)l;<a name="l00867"></a>00867                 <span class="keywordflow">switch</span>(d_data-&gt;layout-&gt;legendPosition())<a name="l00868"></a>00868                 {<a name="l00869"></a>00869                     <span class="keywordflow">case</span> LeftLegend:<a name="l00870"></a>00870                     <span class="keywordflow">case</span> RightLegend:<a name="l00871"></a>00871                         tl-&gt;setMaxCols(1); <span class="comment">// 1 column: align vertical</span><a name="l00872"></a>00872                         <span class="keywordflow">break</span>;<a name="l00873"></a>00873                     <span class="keywordflow">case</span> TopLegend:<a name="l00874"></a>00874                     <span class="keywordflow">case</span> BottomLegend:<a name="l00875"></a>00875                         tl-&gt;setMaxCols(0); <span class="comment">// unlimited</span><a name="l00876"></a>00876                         <span class="keywordflow">break</span>;<a name="l00877"></a>00877                     <span class="keywordflow">case</span> ExternalLegend:<a name="l00878"></a>00878                         <span class="keywordflow">break</span>;<a name="l00879"></a>00879                 }<a name="l00880"></a>00880             }<a name="l00881"></a>00881         }<a name="l00882"></a>00882         updateTabOrder();<a name="l00883"></a>00883     }<a name="l00884"></a>00884 <a name="l00885"></a>00885     updateLayout();<a name="l00886"></a>00886 }</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Feb 26 21:22:37 2007 for Qwt User's Guide by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -