~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.1/doc/html/qwt__plot_8cpp-source.html

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
 
3
<title>Qwt User&apos;s Guide: qwt_plot.cpp Source File</title>
 
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
 
5
<link href="tabs.css" rel="stylesheet" type="text/css">
 
6
</head><body>
 
7
<!-- Generated by Doxygen 1.5.0 -->
 
8
<div class="tabs">
 
9
  <ul>
 
10
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
 
11
    <li><a href="classes.html"><span>Classes</span></a></li>
 
12
    <li id="current"><a href="files.html"><span>Files</span></a></li>
 
13
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
 
14
  </ul></div>
 
15
<div class="tabs">
 
16
  <ul>
 
17
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
 
18
    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
 
19
  </ul></div>
 
20
<h1>qwt_plot.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span>
 
21
<a name="l00002"></a>00002 <span class="comment"> * Qwt Widget Library</span>
 
22
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1997   Josef Wilgen</span>
 
23
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span>
 
24
<a name="l00005"></a>00005 <span class="comment"> *</span>
 
25
<a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
 
26
<a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
 
27
<a name="l00008"></a>00008 <span class="comment"> *****************************************************************************/</span>
 
28
<a name="l00009"></a>00009 
 
29
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;qpainter.h&gt;</span>
 
30
<a name="l00011"></a>00011 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
31
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#include &lt;qguardedptr.h&gt;</span>
 
32
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;qfocusdata.h&gt;</span>
 
33
<a name="l00014"></a>00014 <span class="preprocessor">#else</span>
 
34
<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#include &lt;qpointer.h&gt;</span>
 
35
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;qpaintengine.h&gt;</span>
 
36
<a name="l00017"></a>00017 <span class="preprocessor">#endif</span>
 
37
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#include &lt;qapplication.h&gt;</span>
 
38
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;qevent.h&gt;</span>
 
39
<a name="l00020"></a>00020 <span class="preprocessor">#include "qwt_plot.h"</span>
 
40
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="qwt__plot__dict_8h.html">qwt_plot_dict.h</a>"</span>
 
41
<a name="l00022"></a>00022 <span class="preprocessor">#include "qwt_plot_layout.h"</span>
 
42
<a name="l00023"></a>00023 <span class="preprocessor">#include "qwt_scale_widget.h"</span>
 
43
<a name="l00024"></a>00024 <span class="preprocessor">#include "qwt_scale_engine.h"</span>
 
44
<a name="l00025"></a>00025 <span class="preprocessor">#include "qwt_text_label.h"</span>
 
45
<a name="l00026"></a>00026 <span class="preprocessor">#include "qwt_legend.h"</span>
 
46
<a name="l00027"></a>00027 <span class="preprocessor">#include "qwt_dyngrid_layout.h"</span>
 
47
<a name="l00028"></a>00028 <span class="preprocessor">#include "qwt_plot_canvas.h"</span>
 
48
<a name="l00029"></a>00029 <span class="preprocessor">#include "qwt_paint_buffer.h"</span>
 
49
<a name="l00030"></a>00030 
 
50
<a name="l00031"></a>00031 <span class="keyword">class </span>QwtPlot::PrivateData
 
51
<a name="l00032"></a>00032 {
 
52
<a name="l00033"></a>00033 <span class="keyword">public</span>:
 
53
<a name="l00034"></a>00034 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
54
<a name="l00035"></a>00035 <span class="preprocessor"></span>    QGuardedPtr&lt;QwtTextLabel&gt; lblTitle;
 
55
<a name="l00036"></a>00036     QGuardedPtr&lt;QwtPlotCanvas&gt; <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>;
 
56
<a name="l00037"></a>00037     QGuardedPtr&lt;QwtLegend&gt; <a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">legend</a>;
 
57
<a name="l00038"></a>00038 <span class="preprocessor">#else</span>
 
58
<a name="l00039"></a>00039 <span class="preprocessor"></span>    QPointer&lt;QwtTextLabel&gt; lblTitle;
 
59
<a name="l00040"></a>00040     QPointer&lt;QwtPlotCanvas&gt; <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>;
 
60
<a name="l00041"></a>00041     QPointer&lt;QwtLegend&gt; <a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">legend</a>;
 
61
<a name="l00042"></a>00042 <span class="preprocessor">#endif</span>
 
62
<a name="l00043"></a>00043 <span class="preprocessor"></span>    <a class="code" href="class_qwt_plot_layout.html">QwtPlotLayout</a> *layout;
 
63
<a name="l00044"></a>00044 
 
64
<a name="l00045"></a>00045     <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#3a639850b65bc4dbf22b3f3170d61804">autoReplot</a>;
 
65
<a name="l00046"></a>00046 };
 
66
<a name="l00047"></a>00047 
 
67
<a name="l00052"></a><a class="code" href="class_qwt_plot.html#cde7121614da027e9a1dbc4591613ca7">00052</a> <a class="code" href="class_qwt_plot.html#cde7121614da027e9a1dbc4591613ca7">QwtPlot::QwtPlot</a>(QWidget *parent):
 
68
<a name="l00053"></a>00053     QFrame(parent)
 
69
<a name="l00054"></a>00054 {
 
70
<a name="l00055"></a>00055     initPlot(<a class="code" href="class_qwt_text.html">QwtText</a>());
 
71
<a name="l00056"></a>00056 }
 
72
<a name="l00057"></a>00057 
 
73
<a name="l00063"></a><a class="code" href="class_qwt_plot.html#12888a2101ba2091db0e4710c6a109cb">00063</a> <a class="code" href="class_qwt_plot.html#cde7121614da027e9a1dbc4591613ca7">QwtPlot::QwtPlot</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_text.html">QwtText</a> &amp;title, QWidget *parent):
 
74
<a name="l00064"></a>00064     QFrame(parent)
 
75
<a name="l00065"></a>00065 {
 
76
<a name="l00066"></a>00066     initPlot(<a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">title</a>);
 
77
<a name="l00067"></a>00067 }
 
78
<a name="l00068"></a>00068 
 
79
<a name="l00069"></a>00069 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
80
<a name="l00070"></a>00070 <span class="preprocessor"></span>
 
81
<a name="l00075"></a>00075 <a class="code" href="class_qwt_plot.html#cde7121614da027e9a1dbc4591613ca7">QwtPlot::QwtPlot</a>(QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name):
 
82
<a name="l00076"></a>00076     QFrame(parent, name)
 
83
<a name="l00077"></a>00077 {   
 
84
<a name="l00078"></a>00078     initPlot(<a class="code" href="class_qwt_text.html">QwtText</a>());
 
85
<a name="l00079"></a>00079 }   
 
86
<a name="l00080"></a>00080 <span class="preprocessor">#endif</span>
 
87
<a name="l00081"></a>00081 <span class="preprocessor"></span>
 
88
<a name="l00082"></a>00082 
 
89
<a name="l00084"></a><a class="code" href="class_qwt_plot.html#2b60620e3681810946dcc66002aad016">00084</a> <a class="code" href="class_qwt_plot.html#2b60620e3681810946dcc66002aad016">QwtPlot::~QwtPlot</a>()
 
90
<a name="l00085"></a>00085 {
 
91
<a name="l00086"></a>00086     <a class="code" href="class_qwt_plot_dict.html#cb2e402e05c693433ed7e84696fbdfc0">detachItems</a>(QwtPlotItem::Rtti_PlotItem, <a class="code" href="class_qwt_plot_dict.html#8f36ce63ad81b939313b0347500d2d31">autoDelete</a>());
 
92
<a name="l00087"></a>00087 
 
93
<a name="l00088"></a>00088     <span class="keyword">delete</span> d_data-&gt;layout;
 
94
<a name="l00089"></a>00089     deleteAxesData();
 
95
<a name="l00090"></a>00090     <span class="keyword">delete</span> d_data;
 
96
<a name="l00091"></a>00091 }
 
97
<a name="l00092"></a>00092 
 
98
<a name="l00097"></a>00097 <span class="keywordtype">void</span> QwtPlot::initPlot(<span class="keyword">const</span> <a class="code" href="class_qwt_text.html">QwtText</a> &amp;title)
 
99
<a name="l00098"></a>00098 {
 
100
<a name="l00099"></a>00099     d_data = <span class="keyword">new</span> PrivateData;
 
101
<a name="l00100"></a>00100 
 
102
<a name="l00101"></a>00101 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
103
<a name="l00102"></a>00102 <span class="preprocessor"></span>    setWFlags(Qt::WNoAutoErase);
 
104
<a name="l00103"></a>00103 <span class="preprocessor">#endif </span>
 
105
<a name="l00104"></a>00104 <span class="preprocessor"></span>
 
106
<a name="l00105"></a>00105     d_data-&gt;layout = <span class="keyword">new</span> <a class="code" href="class_qwt_plot_layout.html">QwtPlotLayout</a>;
 
107
<a name="l00106"></a>00106 
 
108
<a name="l00107"></a>00107     d_data-&gt;autoReplot = <span class="keyword">false</span>;
 
109
<a name="l00108"></a>00108 
 
110
<a name="l00109"></a>00109     d_data-&gt;lblTitle = <span class="keyword">new</span> <a class="code" href="class_qwt_text_label.html">QwtTextLabel</a>(<a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">title</a>, <span class="keyword">this</span>);
 
111
<a name="l00110"></a>00110     d_data-&gt;lblTitle-&gt;setFont(QFont(fontInfo().family(), 14, QFont::Bold));
 
112
<a name="l00111"></a>00111 
 
113
<a name="l00112"></a>00112     <a class="code" href="class_qwt_text.html">QwtText</a> text(<a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">title</a>);
 
114
<a name="l00113"></a>00113     <span class="keywordtype">int</span> flags = Qt::AlignCenter;
 
115
<a name="l00114"></a>00114 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
116
<a name="l00115"></a>00115 <span class="preprocessor"></span>    flags |= Qt::WordBreak | Qt::ExpandTabs;
 
117
<a name="l00116"></a>00116 <span class="preprocessor">#else</span>
 
118
<a name="l00117"></a>00117 <span class="preprocessor"></span>    flags |= Qt::TextWordWrap;
 
119
<a name="l00118"></a>00118 <span class="preprocessor">#endif</span>
 
120
<a name="l00119"></a>00119 <span class="preprocessor"></span>    text.setRenderFlags(flags);
 
121
<a name="l00120"></a>00120     d_data-&gt;lblTitle-&gt;setText(text);
 
122
<a name="l00121"></a>00121 
 
123
<a name="l00122"></a>00122     d_data-&gt;legend = NULL;
 
124
<a name="l00123"></a>00123 
 
125
<a name="l00124"></a>00124     initAxesData();
 
126
<a name="l00125"></a>00125 
 
127
<a name="l00126"></a>00126     d_data-&gt;canvas = <span class="keyword">new</span> <a class="code" href="class_qwt_plot.html#ccdb72255f819eb70751e070294496fd">QwtPlotCanvas</a>(<span class="keyword">this</span>);
 
128
<a name="l00127"></a>00127     d_data-&gt;canvas-&gt;setFrameStyle(QFrame::Panel|QFrame::Sunken);
 
129
<a name="l00128"></a>00128     d_data-&gt;canvas-&gt;setLineWidth(2);
 
130
<a name="l00129"></a>00129     d_data-&gt;canvas-&gt;setMidLineWidth(0);
 
131
<a name="l00130"></a>00130 
 
132
<a name="l00131"></a>00131     <a class="code" href="class_qwt_plot.html#6455596162a69876a3504c0017531cf3">updateTabOrder</a>();
 
133
<a name="l00132"></a>00132 
 
134
<a name="l00133"></a>00133     setSizePolicy(QSizePolicy::MinimumExpanding, 
 
135
<a name="l00134"></a>00134         QSizePolicy::MinimumExpanding);
 
136
<a name="l00135"></a>00135 }
 
137
<a name="l00136"></a>00136 
 
138
<a name="l00140"></a><a class="code" href="class_qwt_plot.html#f40d1bfdd9b6cd94e9981db8b254b961">00140</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#f40d1bfdd9b6cd94e9981db8b254b961">QwtPlot::event</a>(QEvent *e)
 
139
<a name="l00141"></a>00141 {
 
140
<a name="l00142"></a>00142     <span class="keywordtype">bool</span> ok = QFrame::event(e);
 
141
<a name="l00143"></a>00143     <span class="keywordflow">switch</span>(e-&gt;type())
 
142
<a name="l00144"></a>00144     {
 
143
<a name="l00145"></a>00145 #<span class="keywordflow">if</span> QT_VERSION &lt; 0x040000
 
144
<a name="l00146"></a>00146         <span class="keywordflow">case</span> QEvent::LayoutHint:
 
145
<a name="l00147"></a>00147 #<span class="keywordflow">else</span>
 
146
<a name="l00148"></a>00148         <span class="keywordflow">case</span> QEvent::LayoutRequest:
 
147
<a name="l00149"></a>00149 #endif
 
148
<a name="l00150"></a>00150             <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
149
<a name="l00151"></a>00151             <span class="keywordflow">break</span>;
 
150
<a name="l00152"></a>00152 <span class="preprocessor">#if QT_VERSION &gt;= 0x040000</span>
 
151
<a name="l00153"></a>00153 <span class="preprocessor"></span>        <span class="keywordflow">case</span> QEvent::PolishRequest:
 
152
<a name="l00154"></a>00154             <a class="code" href="class_qwt_plot.html#99ad643676cf0cd5f11478f154102df2">polish</a>();
 
153
<a name="l00155"></a>00155             <span class="keywordflow">break</span>;
 
154
<a name="l00156"></a>00156 <span class="preprocessor">#endif</span>
 
155
<a name="l00157"></a>00157 <span class="preprocessor"></span>        <span class="keywordflow">default</span>:;
 
156
<a name="l00158"></a>00158     }
 
157
<a name="l00159"></a>00159     <span class="keywordflow">return</span> ok;
 
158
<a name="l00160"></a>00160 }
 
159
<a name="l00161"></a>00161 
 
160
<a name="l00163"></a><a class="code" href="class_qwt_plot.html#ea78ab565d05b69b8730a4af2a11f07e">00163</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#ea78ab565d05b69b8730a4af2a11f07e">QwtPlot::autoRefresh</a>()
 
161
<a name="l00164"></a>00164 {
 
162
<a name="l00165"></a>00165     <span class="keywordflow">if</span> (d_data-&gt;autoReplot)
 
163
<a name="l00166"></a>00166         <a class="code" href="class_qwt_plot.html#7b094e29b8e92b00e36517d0d7633c4b">replot</a>();
 
164
<a name="l00167"></a>00167 }
 
165
<a name="l00168"></a>00168 
 
166
<a name="l00184"></a><a class="code" href="class_qwt_plot.html#654934ec2ad167101dacb5174f5172d6">00184</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#654934ec2ad167101dacb5174f5172d6">QwtPlot::setAutoReplot</a>(<span class="keywordtype">bool</span> tf)
 
167
<a name="l00185"></a>00185 {
 
168
<a name="l00186"></a>00186     d_data-&gt;autoReplot = tf;
 
169
<a name="l00187"></a>00187 }
 
170
<a name="l00188"></a>00188 
 
171
<a name="l00190"></a><a class="code" href="class_qwt_plot.html#3a639850b65bc4dbf22b3f3170d61804">00190</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#3a639850b65bc4dbf22b3f3170d61804">QwtPlot::autoReplot</a>()<span class="keyword"> const</span>
 
172
<a name="l00191"></a>00191 <span class="keyword"></span>{
 
173
<a name="l00192"></a>00192     <span class="keywordflow">return</span> d_data-&gt;autoReplot; 
 
174
<a name="l00193"></a>00193 }
 
175
<a name="l00194"></a>00194 
 
176
<a name="l00199"></a><a class="code" href="class_qwt_plot.html#9a7f0b219b404e5bed5dfca26c5c06a7">00199</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#9a7f0b219b404e5bed5dfca26c5c06a7">QwtPlot::setTitle</a>(<span class="keyword">const</span> QString &amp;title)
 
177
<a name="l00200"></a>00200 {
 
178
<a name="l00201"></a>00201     <span class="keywordflow">if</span> ( title != d_data-&gt;lblTitle-&gt;text().text() )
 
179
<a name="l00202"></a>00202     {
 
180
<a name="l00203"></a>00203         d_data-&gt;lblTitle-&gt;setText(title);
 
181
<a name="l00204"></a>00204         <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
182
<a name="l00205"></a>00205     }
 
183
<a name="l00206"></a>00206 }
 
184
<a name="l00207"></a>00207 
 
185
<a name="l00212"></a><a class="code" href="class_qwt_plot.html#032ced8ddfad7483a372214954203719">00212</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#9a7f0b219b404e5bed5dfca26c5c06a7">QwtPlot::setTitle</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_text.html">QwtText</a> &amp;title)
 
186
<a name="l00213"></a>00213 {
 
187
<a name="l00214"></a>00214     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">title</a> != d_data-&gt;lblTitle-&gt;text() )
 
188
<a name="l00215"></a>00215     {
 
189
<a name="l00216"></a>00216         d_data-&gt;lblTitle-&gt;setText(<a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">title</a>);
 
190
<a name="l00217"></a>00217         <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
191
<a name="l00218"></a>00218     }
 
192
<a name="l00219"></a>00219 }
 
193
<a name="l00220"></a>00220 
 
194
<a name="l00222"></a><a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">00222</a> <a class="code" href="class_qwt_text.html">QwtText</a> <a class="code" href="class_qwt_plot.html#fb56eb977718774dff0fb4127f200bb0">QwtPlot::title</a>()<span class="keyword"> const</span>
 
195
<a name="l00223"></a>00223 <span class="keyword"></span>{
 
196
<a name="l00224"></a>00224     <span class="keywordflow">return</span> d_data-&gt;lblTitle-&gt;text();
 
197
<a name="l00225"></a>00225 }
 
198
<a name="l00226"></a>00226 
 
199
<a name="l00228"></a><a class="code" href="class_qwt_plot.html#9156b14a6f67f6279a16fea063ce1d14">00228</a> <a class="code" href="class_qwt_plot_layout.html">QwtPlotLayout</a> *<a class="code" href="class_qwt_plot.html#9156b14a6f67f6279a16fea063ce1d14">QwtPlot::plotLayout</a>()
 
200
<a name="l00229"></a>00229 {
 
201
<a name="l00230"></a>00230     <span class="keywordflow">return</span> d_data-&gt;layout;
 
202
<a name="l00231"></a>00231 }
 
203
<a name="l00232"></a>00232 
 
204
<a name="l00234"></a><a class="code" href="class_qwt_plot.html#d4b695580cdf504dd0996177c56ebe0b">00234</a> <span class="keyword">const</span> <a class="code" href="class_qwt_plot_layout.html">QwtPlotLayout</a> *<a class="code" href="class_qwt_plot.html#9156b14a6f67f6279a16fea063ce1d14">QwtPlot::plotLayout</a>()<span class="keyword"> const</span>
 
205
<a name="l00235"></a>00235 <span class="keyword"></span>{
 
206
<a name="l00236"></a>00236     <span class="keywordflow">return</span> d_data-&gt;layout;
 
207
<a name="l00237"></a>00237 }
 
208
<a name="l00238"></a>00238 
 
209
<a name="l00240"></a><a class="code" href="class_qwt_plot.html#c39356b86ed70ebf256a8ae964910206">00240</a> <a class="code" href="class_qwt_text_label.html">QwtTextLabel</a> *<a class="code" href="class_qwt_plot.html#c39356b86ed70ebf256a8ae964910206">QwtPlot::titleLabel</a>()
 
210
<a name="l00241"></a>00241 {
 
211
<a name="l00242"></a>00242     <span class="keywordflow">return</span> d_data-&gt;lblTitle;
 
212
<a name="l00243"></a>00243 }
 
213
<a name="l00244"></a>00244 
 
214
<a name="l00248"></a><a class="code" href="class_qwt_plot.html#09dcd60b8f2ce62904f4c21dcbfe2fa1">00248</a> <span class="keyword">const</span> <a class="code" href="class_qwt_text_label.html">QwtTextLabel</a> *<a class="code" href="class_qwt_plot.html#c39356b86ed70ebf256a8ae964910206">QwtPlot::titleLabel</a>()<span class="keyword"> const</span>
 
215
<a name="l00249"></a>00249 <span class="keyword"></span>{
 
216
<a name="l00250"></a>00250     <span class="keywordflow">return</span> d_data-&gt;lblTitle;
 
217
<a name="l00251"></a>00251 }
 
218
<a name="l00252"></a>00252 
 
219
<a name="l00257"></a><a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">00257</a> <a class="code" href="class_qwt_legend.html">QwtLegend</a> *<a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">QwtPlot::legend</a>()
 
220
<a name="l00258"></a>00258 { 
 
221
<a name="l00259"></a>00259     <span class="keywordflow">return</span> d_data-&gt;legend;
 
222
<a name="l00260"></a>00260 }   
 
223
<a name="l00261"></a>00261 
 
224
<a name="l00266"></a><a class="code" href="class_qwt_plot.html#f8ac9c9332b8625699d38d3d79354c57">00266</a> <span class="keyword">const</span> <a class="code" href="class_qwt_legend.html">QwtLegend</a> *<a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">QwtPlot::legend</a>()<span class="keyword"> const</span>
 
225
<a name="l00267"></a>00267 <span class="keyword"></span>{ 
 
226
<a name="l00268"></a>00268     <span class="keywordflow">return</span> d_data-&gt;legend;
 
227
<a name="l00269"></a>00269 }   
 
228
<a name="l00270"></a>00270 
 
229
<a name="l00271"></a>00271 
 
230
<a name="l00275"></a><a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">00275</a> <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">QwtPlot::canvas</a>()
 
231
<a name="l00276"></a>00276 { 
 
232
<a name="l00277"></a>00277     <span class="keywordflow">return</span> d_data-&gt;canvas;
 
233
<a name="l00278"></a>00278 }   
 
234
<a name="l00279"></a>00279 
 
235
<a name="l00283"></a><a class="code" href="class_qwt_plot.html#0e45633c978e7514af0d7ad032359670">00283</a> <span class="keyword">const</span> <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">QwtPlot::canvas</a>()<span class="keyword"> const</span>
 
236
<a name="l00284"></a>00284 <span class="keyword"></span>{ 
 
237
<a name="l00285"></a>00285     <span class="keywordflow">return</span> d_data-&gt;canvas;
 
238
<a name="l00286"></a>00286 }
 
239
<a name="l00287"></a>00287 
 
240
<a name="l00289"></a><a class="code" href="class_qwt_plot.html#99ad643676cf0cd5f11478f154102df2">00289</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#99ad643676cf0cd5f11478f154102df2">QwtPlot::polish</a>()
 
241
<a name="l00290"></a>00290 {
 
242
<a name="l00291"></a>00291     <a class="code" href="class_qwt_plot.html#7b094e29b8e92b00e36517d0d7633c4b">replot</a>();
 
243
<a name="l00292"></a>00292 
 
244
<a name="l00293"></a>00293 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
245
<a name="l00294"></a>00294 <span class="preprocessor"></span>    QFrame::polish();
 
246
<a name="l00295"></a>00295 <span class="preprocessor">#endif</span>
 
247
<a name="l00296"></a>00296 <span class="preprocessor"></span>}
 
248
<a name="l00297"></a>00297 
 
249
<a name="l00303"></a><a class="code" href="class_qwt_plot.html#2f57c941dd36f96c395b339474418fba">00303</a> QSize <a class="code" href="class_qwt_plot.html#2f57c941dd36f96c395b339474418fba">QwtPlot::sizeHint</a>()<span class="keyword"> const</span>
 
250
<a name="l00304"></a>00304 <span class="keyword"></span>{
 
251
<a name="l00305"></a>00305     <span class="keywordtype">int</span> dw = 0;
 
252
<a name="l00306"></a>00306     <span class="keywordtype">int</span> dh = 0;
 
253
<a name="l00307"></a>00307     <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> axisId = 0; axisId &lt; axisCnt; axisId++ )
 
254
<a name="l00308"></a>00308     {
 
255
<a name="l00309"></a>00309         <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#a6d08ba153cb46662692611b5c38bbe0">axisEnabled</a>(axisId) )
 
256
<a name="l00310"></a>00310         {   
 
257
<a name="l00311"></a>00311             <span class="keyword">const</span> <span class="keywordtype">int</span> niceDist = 40;
 
258
<a name="l00312"></a>00312             <span class="keyword">const</span> <a class="code" href="class_qwt_scale_widget.html">QwtScaleWidget</a> *scaleWidget = <a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId);
 
259
<a name="l00313"></a>00313             <span class="keyword">const</span> <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> &amp;scaleDiv = scaleWidget-&gt;<a class="code" href="class_qwt_scale_widget.html#2f6d30104f89c45d4d18f060ebabb8b9">scaleDraw</a>()-&gt;<a class="code" href="class_qwt_abstract_scale_draw.html#d15e796d2fd8bd1e2cfa66715bf58e2e">scaleDiv</a>();
 
260
<a name="l00314"></a>00314             <span class="keyword">const</span> <span class="keywordtype">int</span> majCnt = scaleDiv.<a class="code" href="class_qwt_scale_div.html#991862ca84dc810d8500b360a0ed7a4f">ticks</a>(QwtScaleDiv::MajorTick).count();
 
261
<a name="l00315"></a>00315 
 
262
<a name="l00316"></a>00316             <span class="keywordflow">if</span> ( axisId == yLeft || axisId == yRight )
 
263
<a name="l00317"></a>00317             {
 
264
<a name="l00318"></a>00318                 <span class="keywordtype">int</span> hDiff = (majCnt - 1) * niceDist 
 
265
<a name="l00319"></a>00319                     - scaleWidget-&gt;<a class="code" href="class_qwt_scale_widget.html#3bcdf28039f00569ff42999335bf0c86">minimumSizeHint</a>().height();
 
266
<a name="l00320"></a>00320                 <span class="keywordflow">if</span> ( hDiff &gt; dh )
 
267
<a name="l00321"></a>00321                     dh = hDiff;
 
268
<a name="l00322"></a>00322             }
 
269
<a name="l00323"></a>00323             <span class="keywordflow">else</span>
 
270
<a name="l00324"></a>00324             {
 
271
<a name="l00325"></a>00325                 <span class="keywordtype">int</span> wDiff = (majCnt - 1) * niceDist 
 
272
<a name="l00326"></a>00326                     - scaleWidget-&gt;<a class="code" href="class_qwt_scale_widget.html#3bcdf28039f00569ff42999335bf0c86">minimumSizeHint</a>().width();
 
273
<a name="l00327"></a>00327                 <span class="keywordflow">if</span> ( wDiff &gt; dw )
 
274
<a name="l00328"></a>00328                     dw = wDiff;
 
275
<a name="l00329"></a>00329             }
 
276
<a name="l00330"></a>00330         }
 
277
<a name="l00331"></a>00331     }
 
278
<a name="l00332"></a>00332     <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#1f013570f561aba1af14b5c98da2132b">minimumSizeHint</a>() + QSize(dw, dh);
 
279
<a name="l00333"></a>00333 }
 
280
<a name="l00334"></a>00334 
 
281
<a name="l00338"></a><a class="code" href="class_qwt_plot.html#1f013570f561aba1af14b5c98da2132b">00338</a> QSize <a class="code" href="class_qwt_plot.html#1f013570f561aba1af14b5c98da2132b">QwtPlot::minimumSizeHint</a>()<span class="keyword"> const</span>
 
282
<a name="l00339"></a>00339 <span class="keyword"></span>{
 
283
<a name="l00340"></a>00340     QSize hint = d_data-&gt;layout-&gt;minimumSizeHint(<span class="keyword">this</span>);
 
284
<a name="l00341"></a>00341     hint += QSize(2 * frameWidth(), 2 * frameWidth());
 
285
<a name="l00342"></a>00342 
 
286
<a name="l00343"></a>00343     <span class="keywordflow">return</span> hint;
 
287
<a name="l00344"></a>00344 }
 
288
<a name="l00345"></a>00345 
 
289
<a name="l00347"></a><a class="code" href="class_qwt_plot.html#a4d5f73681880b9770bb6a604c415987">00347</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#a4d5f73681880b9770bb6a604c415987">QwtPlot::resizeEvent</a>(QResizeEvent *e)
 
290
<a name="l00348"></a>00348 {
 
291
<a name="l00349"></a>00349     QFrame::resizeEvent(e);
 
292
<a name="l00350"></a>00350     <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
293
<a name="l00351"></a>00351 }
 
294
<a name="l00352"></a>00352 
 
295
<a name="l00363"></a><a class="code" href="class_qwt_plot.html#7b094e29b8e92b00e36517d0d7633c4b">00363</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#7b094e29b8e92b00e36517d0d7633c4b">QwtPlot::replot</a>()
 
296
<a name="l00364"></a>00364 {
 
297
<a name="l00365"></a>00365     <span class="keywordtype">bool</span> doAutoReplot = <a class="code" href="class_qwt_plot.html#3a639850b65bc4dbf22b3f3170d61804">autoReplot</a>();
 
298
<a name="l00366"></a>00366     <a class="code" href="class_qwt_plot.html#654934ec2ad167101dacb5174f5172d6">setAutoReplot</a>(<span class="keyword">false</span>);
 
299
<a name="l00367"></a>00367 
 
300
<a name="l00368"></a>00368     <a class="code" href="class_qwt_plot.html#1fb2dbc3697a66024d48c08b1d18f8a5">updateAxes</a>();
 
301
<a name="l00369"></a>00369 
 
302
<a name="l00370"></a>00370     <span class="comment">/*</span>
 
303
<a name="l00371"></a>00371 <span class="comment">      Maybe the layout needs to be updated, because of changed</span>
 
304
<a name="l00372"></a>00372 <span class="comment">      axes labels. We need to process them here before painting</span>
 
305
<a name="l00373"></a>00373 <span class="comment">      to avoid that scales and canvas get out of sync.</span>
 
306
<a name="l00374"></a>00374 <span class="comment">     */</span>
 
307
<a name="l00375"></a>00375 <span class="preprocessor">#if QT_VERSION &gt;= 0x040000</span>
 
308
<a name="l00376"></a>00376 <span class="preprocessor"></span>    QApplication::sendPostedEvents(<span class="keyword">this</span>, QEvent::LayoutRequest);
 
309
<a name="l00377"></a>00377 <span class="preprocessor">#else</span>
 
310
<a name="l00378"></a>00378 <span class="preprocessor"></span>    QApplication::sendPostedEvents(<span class="keyword">this</span>, QEvent::LayoutHint);
 
311
<a name="l00379"></a>00379 <span class="preprocessor">#endif</span>
 
312
<a name="l00380"></a>00380 <span class="preprocessor"></span>
 
313
<a name="l00381"></a>00381     <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> &amp;<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a> = *d_data-&gt;canvas;
 
314
<a name="l00382"></a>00382 
 
315
<a name="l00383"></a>00383     <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.<a class="code" href="class_qwt_plot_canvas.html#d03018bfc24f361e4ba359643c5c23b6">invalidatePaintCache</a>();
 
316
<a name="l00384"></a>00384 
 
317
<a name="l00385"></a>00385     <span class="comment">/*</span>
 
318
<a name="l00386"></a>00386 <span class="comment">      In case of cached or packed painting the canvas</span>
 
319
<a name="l00387"></a>00387 <span class="comment">      is repainted completely and doesn't need to be erased.</span>
 
320
<a name="l00388"></a>00388 <span class="comment">     */</span>
 
321
<a name="l00389"></a>00389     <span class="keyword">const</span> <span class="keywordtype">bool</span> erase = 
 
322
<a name="l00390"></a>00390         !<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.<a class="code" href="class_qwt_plot_canvas.html#3dc8278bd9ce9b9d801706d61e139baf">testPaintAttribute</a>(QwtPlotCanvas::PaintPacked) 
 
323
<a name="l00391"></a>00391         &amp;&amp; !<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.<a class="code" href="class_qwt_plot_canvas.html#3dc8278bd9ce9b9d801706d61e139baf">testPaintAttribute</a>(QwtPlotCanvas::PaintCached);
 
324
<a name="l00392"></a>00392 
 
325
<a name="l00393"></a>00393 <span class="preprocessor">#if QT_VERSION &gt;= 0x040000</span>
 
326
<a name="l00394"></a>00394 <span class="preprocessor"></span>    <span class="keyword">const</span> <span class="keywordtype">bool</span> noBackgroundMode = <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.testAttribute(Qt::WA_NoBackground);
 
327
<a name="l00395"></a>00395     <span class="keywordflow">if</span> ( !erase &amp;&amp; !noBackgroundMode )
 
328
<a name="l00396"></a>00396         <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.setAttribute(Qt::WA_NoBackground, <span class="keyword">true</span>);
 
329
<a name="l00397"></a>00397 
 
330
<a name="l00398"></a>00398     <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.repaint(<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.contentsRect());
 
331
<a name="l00399"></a>00399 
 
332
<a name="l00400"></a>00400     <span class="keywordflow">if</span> ( !erase &amp;&amp; !noBackgroundMode )
 
333
<a name="l00401"></a>00401         <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.setAttribute(Qt::WA_NoBackground, <span class="keyword">false</span>);
 
334
<a name="l00402"></a>00402 <span class="preprocessor">#else</span>
 
335
<a name="l00403"></a>00403 <span class="preprocessor"></span>    <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.repaint(<a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>.contentsRect(), erase);
 
336
<a name="l00404"></a>00404 <span class="preprocessor">#endif</span>
 
337
<a name="l00405"></a>00405 <span class="preprocessor"></span>
 
338
<a name="l00406"></a>00406     <a class="code" href="class_qwt_plot.html#654934ec2ad167101dacb5174f5172d6">setAutoReplot</a>(doAutoReplot);
 
339
<a name="l00407"></a>00407 }
 
340
<a name="l00408"></a>00408 
 
341
<a name="l00413"></a><a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">00413</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">QwtPlot::updateLayout</a>()
 
342
<a name="l00414"></a>00414 {
 
343
<a name="l00415"></a>00415     d_data-&gt;layout-&gt;activate(<span class="keyword">this</span>, contentsRect());
 
344
<a name="l00416"></a>00416 
 
345
<a name="l00417"></a>00417     <span class="comment">//</span>
 
346
<a name="l00418"></a>00418     <span class="comment">// resize and show the visible widgets</span>
 
347
<a name="l00419"></a>00419     <span class="comment">//</span>
 
348
<a name="l00420"></a>00420     <span class="keywordflow">if</span> (!d_data-&gt;lblTitle-&gt;text().isEmpty())
 
349
<a name="l00421"></a>00421     {
 
350
<a name="l00422"></a>00422         d_data-&gt;lblTitle-&gt;setGeometry(d_data-&gt;layout-&gt;titleRect());
 
351
<a name="l00423"></a>00423         <span class="keywordflow">if</span> (!d_data-&gt;lblTitle-&gt;isVisible())
 
352
<a name="l00424"></a>00424             d_data-&gt;lblTitle-&gt;show();
 
353
<a name="l00425"></a>00425     }
 
354
<a name="l00426"></a>00426     <span class="keywordflow">else</span>
 
355
<a name="l00427"></a>00427         d_data-&gt;lblTitle-&gt;hide();
 
356
<a name="l00428"></a>00428 
 
357
<a name="l00429"></a>00429     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> axisId = 0; axisId &lt; axisCnt; axisId++ )
 
358
<a name="l00430"></a>00430     {
 
359
<a name="l00431"></a>00431         <span class="keywordflow">if</span> (<a class="code" href="class_qwt_plot.html#a6d08ba153cb46662692611b5c38bbe0">axisEnabled</a>(axisId) )
 
360
<a name="l00432"></a>00432         {
 
361
<a name="l00433"></a>00433             <a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId)-&gt;setGeometry(d_data-&gt;layout-&gt;scaleRect(axisId));
 
362
<a name="l00434"></a>00434 
 
363
<a name="l00435"></a>00435             <span class="keywordflow">if</span> ( axisId == xBottom || axisId == xTop )
 
364
<a name="l00436"></a>00436             {
 
365
<a name="l00437"></a>00437                 QRegion r(d_data-&gt;layout-&gt;scaleRect(axisId));
 
366
<a name="l00438"></a>00438                 <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#a6d08ba153cb46662692611b5c38bbe0">axisEnabled</a>(yLeft) )
 
367
<a name="l00439"></a>00439                     r = r.subtract(QRegion(d_data-&gt;layout-&gt;scaleRect(yLeft)));
 
368
<a name="l00440"></a>00440                 <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#a6d08ba153cb46662692611b5c38bbe0">axisEnabled</a>(yRight) )
 
369
<a name="l00441"></a>00441                     r = r.subtract(QRegion(d_data-&gt;layout-&gt;scaleRect(yRight)));
 
370
<a name="l00442"></a>00442                 r.translate(-d_data-&gt;layout-&gt;scaleRect(axisId).x(), 
 
371
<a name="l00443"></a>00443                     -d_data-&gt;layout-&gt;scaleRect(axisId).y());
 
372
<a name="l00444"></a>00444 
 
373
<a name="l00445"></a>00445                 <a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId)-&gt;setMask(r);
 
374
<a name="l00446"></a>00446             }
 
375
<a name="l00447"></a>00447             <span class="keywordflow">if</span> (!<a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId)-&gt;isVisible())
 
376
<a name="l00448"></a>00448                 <a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId)-&gt;show();
 
377
<a name="l00449"></a>00449         }
 
378
<a name="l00450"></a>00450         <span class="keywordflow">else</span>
 
379
<a name="l00451"></a>00451             <a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId)-&gt;hide();
 
380
<a name="l00452"></a>00452     }
 
381
<a name="l00453"></a>00453 
 
382
<a name="l00454"></a>00454     <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; 
 
383
<a name="l00455"></a>00455         d_data-&gt;layout-&gt;legendPosition() != ExternalLegend )
 
384
<a name="l00456"></a>00456     {
 
385
<a name="l00457"></a>00457         <span class="keywordflow">if</span> (d_data-&gt;legend-&gt;itemCount() &gt; 0)
 
386
<a name="l00458"></a>00458         {
 
387
<a name="l00459"></a>00459             d_data-&gt;legend-&gt;setGeometry(d_data-&gt;layout-&gt;legendRect());
 
388
<a name="l00460"></a>00460             d_data-&gt;legend-&gt;show();
 
389
<a name="l00461"></a>00461         }
 
390
<a name="l00462"></a>00462         <span class="keywordflow">else</span>
 
391
<a name="l00463"></a>00463             d_data-&gt;legend-&gt;hide();
 
392
<a name="l00464"></a>00464     }
 
393
<a name="l00465"></a>00465 
 
394
<a name="l00466"></a>00466     d_data-&gt;canvas-&gt;setGeometry(d_data-&gt;layout-&gt;canvasRect());
 
395
<a name="l00467"></a>00467 }
 
396
<a name="l00468"></a>00468 
 
397
<a name="l00477"></a><a class="code" href="class_qwt_plot.html#6455596162a69876a3504c0017531cf3">00477</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#6455596162a69876a3504c0017531cf3">QwtPlot::updateTabOrder</a>()
 
398
<a name="l00478"></a>00478 {
 
399
<a name="l00479"></a>00479 <span class="preprocessor">#if QT_VERSION &gt;= 0x040000</span>
 
400
<a name="l00480"></a>00480 <span class="preprocessor"></span>    <span class="keyword">using namespace </span>Qt; <span class="comment">// QWidget::NoFocus/Qt::NoFocus</span>
 
401
<a name="l00481"></a>00481 <span class="preprocessor">#else</span>
 
402
<a name="l00482"></a>00482 <span class="preprocessor"></span>    <span class="keywordflow">if</span> ( d_data-&gt;canvas-&gt;focusPolicy() == NoFocus )
 
403
<a name="l00483"></a>00483         <span class="keywordflow">return</span>;
 
404
<a name="l00484"></a>00484 <span class="preprocessor">#endif</span>
 
405
<a name="l00485"></a>00485 <span class="preprocessor"></span>    <span class="keywordflow">if</span> ( d_data-&gt;legend.isNull()  
 
406
<a name="l00486"></a>00486         || d_data-&gt;layout-&gt;legendPosition() == ExternalLegend
 
407
<a name="l00487"></a>00487         || d_data-&gt;legend-&gt;legendItems().count() == 0 )
 
408
<a name="l00488"></a>00488     {
 
409
<a name="l00489"></a>00489         <span class="keywordflow">return</span>;
 
410
<a name="l00490"></a>00490     }
 
411
<a name="l00491"></a>00491 
 
412
<a name="l00492"></a>00492     <span class="comment">// Depending on the position of the legend the </span>
 
413
<a name="l00493"></a>00493     <span class="comment">// tab order will be changed that the canvas is</span>
 
414
<a name="l00494"></a>00494     <span class="comment">// next to the last legend item, or before</span>
 
415
<a name="l00495"></a>00495     <span class="comment">// the first one. </span>
 
416
<a name="l00496"></a>00496 
 
417
<a name="l00497"></a>00497     <span class="keyword">const</span> <span class="keywordtype">bool</span> canvasFirst = 
 
418
<a name="l00498"></a>00498         d_data-&gt;layout-&gt;legendPosition() == QwtPlot::BottomLegend ||
 
419
<a name="l00499"></a>00499         d_data-&gt;layout-&gt;legendPosition() == QwtPlot::RightLegend;
 
420
<a name="l00500"></a>00500 
 
421
<a name="l00501"></a>00501     QWidget *previous = NULL; 
 
422
<a name="l00502"></a>00502 
 
423
<a name="l00503"></a>00503     QWidget *w;
 
424
<a name="l00504"></a>00504 <span class="preprocessor">#if QT_VERSION &gt;= 0x040000</span>
 
425
<a name="l00505"></a>00505 <span class="preprocessor"></span>    w = d_data-&gt;canvas;
 
426
<a name="l00506"></a>00506     <span class="keywordflow">while</span> ( ( w = w-&gt;nextInFocusChain() ) != d_data-&gt;canvas )
 
427
<a name="l00507"></a>00507 <span class="preprocessor">#else</span>
 
428
<a name="l00508"></a>00508 <span class="preprocessor"></span>    <span class="keywordflow">if</span> ( focusData() == NULL )
 
429
<a name="l00509"></a>00509         <span class="keywordflow">return</span>;
 
430
<a name="l00510"></a>00510 
 
431
<a name="l00511"></a>00511     <span class="keywordflow">while</span> ( focusData()-&gt;next() != d_data-&gt;canvas );
 
432
<a name="l00512"></a>00512     <span class="keywordflow">while</span> ( (w = focusData()-&gt;next()) != d_data-&gt;canvas )
 
433
<a name="l00513"></a>00513 <span class="preprocessor">#endif</span>
 
434
<a name="l00514"></a>00514 <span class="preprocessor"></span>    {
 
435
<a name="l00515"></a>00515         <span class="keywordtype">bool</span> isLegendItem = <span class="keyword">false</span>;
 
436
<a name="l00516"></a>00516         <span class="keywordflow">if</span> ( w-&gt;focusPolicy() != NoFocus 
 
437
<a name="l00517"></a>00517             &amp;&amp; w-&gt;parent() &amp;&amp; w-&gt;parent() == d_data-&gt;legend-&gt;contentsWidget() )
 
438
<a name="l00518"></a>00518         {
 
439
<a name="l00519"></a>00519             isLegendItem = <span class="keyword">true</span>;
 
440
<a name="l00520"></a>00520         }
 
441
<a name="l00521"></a>00521 
 
442
<a name="l00522"></a>00522         <span class="keywordflow">if</span> ( canvasFirst )
 
443
<a name="l00523"></a>00523         {
 
444
<a name="l00524"></a>00524             <span class="keywordflow">if</span> ( isLegendItem )
 
445
<a name="l00525"></a>00525                 <span class="keywordflow">break</span>;
 
446
<a name="l00526"></a>00526 
 
447
<a name="l00527"></a>00527             previous = w;
 
448
<a name="l00528"></a>00528         }
 
449
<a name="l00529"></a>00529         <span class="keywordflow">else</span>
 
450
<a name="l00530"></a>00530         {
 
451
<a name="l00531"></a>00531             <span class="keywordflow">if</span> ( isLegendItem )
 
452
<a name="l00532"></a>00532                 previous = w;
 
453
<a name="l00533"></a>00533             <span class="keywordflow">else</span>
 
454
<a name="l00534"></a>00534             {
 
455
<a name="l00535"></a>00535                 <span class="keywordflow">if</span> ( previous )
 
456
<a name="l00536"></a>00536                     <span class="keywordflow">break</span>;
 
457
<a name="l00537"></a>00537             }
 
458
<a name="l00538"></a>00538         }
 
459
<a name="l00539"></a>00539     }
 
460
<a name="l00540"></a>00540 
 
461
<a name="l00541"></a>00541     <span class="keywordflow">if</span> ( previous &amp;&amp; previous != d_data-&gt;canvas)
 
462
<a name="l00542"></a>00542         setTabOrder(previous, d_data-&gt;canvas);
 
463
<a name="l00543"></a>00543 }
 
464
<a name="l00544"></a>00544 
 
465
<a name="l00554"></a><a class="code" href="class_qwt_plot.html#dd1b88d8312e2671652d23f8181f2433">00554</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#dd1b88d8312e2671652d23f8181f2433">QwtPlot::drawCanvas</a>(QPainter *painter)
 
466
<a name="l00555"></a>00555 {
 
467
<a name="l00556"></a>00556     <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a> maps[axisCnt];
 
468
<a name="l00557"></a>00557     <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> axisId = 0; axisId &lt; axisCnt; axisId++ )
 
469
<a name="l00558"></a>00558         maps[axisId] = <a class="code" href="class_qwt_plot.html#44dc140e8503bb44da7921841f31051c">canvasMap</a>(axisId);
 
470
<a name="l00559"></a>00559 
 
471
<a name="l00560"></a>00560     <a class="code" href="class_qwt_plot.html#e36e68025f4f8b460d690ea7c7a04d9e">drawItems</a>(painter, 
 
472
<a name="l00561"></a>00561         d_data-&gt;canvas-&gt;contentsRect(), maps, <a class="code" href="class_qwt_plot_print_filter.html">QwtPlotPrintFilter</a>());
 
473
<a name="l00562"></a>00562 }
 
474
<a name="l00563"></a>00563 
 
475
<a name="l00572"></a><a class="code" href="class_qwt_plot.html#e36e68025f4f8b460d690ea7c7a04d9e">00572</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#e36e68025f4f8b460d690ea7c7a04d9e">QwtPlot::drawItems</a>(QPainter *painter, <span class="keyword">const</span> QRect &amp;rect, 
 
476
<a name="l00573"></a>00573         <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a> map[axisCnt], 
 
477
<a name="l00574"></a>00574         <span class="keyword">const</span> <a class="code" href="class_qwt_plot_print_filter.html">QwtPlotPrintFilter</a> &amp;pfilter)<span class="keyword"> const</span>
 
478
<a name="l00575"></a>00575 <span class="keyword"></span>{
 
479
<a name="l00576"></a>00576     <span class="keyword">const</span> <a class="code" href="qwt__plot__dict_8h.html#375ca32f3e8a24c8eeb076a637ecd1d8">QwtPlotItemList</a>&amp; itmList = <a class="code" href="class_qwt_plot_dict.html#49d60b01e53a33423987aa80559449f9">itemList</a>();
 
480
<a name="l00577"></a>00577     <span class="keywordflow">for</span> ( <a class="code" href="qwt__plot__dict_8h.html#e2ff587c6b81897fcff5c267c3a416e7">QwtPlotItemIterator</a> it = itmList.begin();
 
481
<a name="l00578"></a>00578         it != itmList.end(); ++it )
 
482
<a name="l00579"></a>00579     {
 
483
<a name="l00580"></a>00580         <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a> *item = *it;
 
484
<a name="l00581"></a>00581         <span class="keywordflow">if</span> ( item &amp;&amp; item-&gt;isVisible() )
 
485
<a name="l00582"></a>00582         {
 
486
<a name="l00583"></a>00583             <span class="keywordflow">if</span> ( !(pfilter.<a class="code" href="class_qwt_plot_print_filter.html#32a2f1df034b8ca130054f1ae034dad0">options</a>() &amp; QwtPlotPrintFilter::PrintGrid)
 
487
<a name="l00584"></a>00584                 &amp;&amp; item-&gt;rtti() == QwtPlotItem::Rtti_PlotGrid )
 
488
<a name="l00585"></a>00585             {
 
489
<a name="l00586"></a>00586                 <span class="keywordflow">continue</span>;
 
490
<a name="l00587"></a>00587             }
 
491
<a name="l00588"></a>00588 
 
492
<a name="l00589"></a>00589             painter-&gt;save();
 
493
<a name="l00590"></a>00590 
 
494
<a name="l00591"></a>00591 <span class="preprocessor">#if QT_VERSION &gt;= 0x040000</span>
 
495
<a name="l00592"></a>00592 <span class="preprocessor"></span>            painter-&gt;setRenderHint(QPainter::Antialiasing,
 
496
<a name="l00593"></a>00593                 item-&gt;testRenderHint(QwtPlotItem::RenderAntialiased) );
 
497
<a name="l00594"></a>00594 <span class="preprocessor">#endif</span>
 
498
<a name="l00595"></a>00595 <span class="preprocessor"></span>
 
499
<a name="l00596"></a>00596             item-&gt;draw(painter, 
 
500
<a name="l00597"></a>00597                 map[item-&gt;xAxis()], map[item-&gt;yAxis()],
 
501
<a name="l00598"></a>00598                 rect);
 
502
<a name="l00599"></a>00599 
 
503
<a name="l00600"></a>00600             painter-&gt;restore();
 
504
<a name="l00601"></a>00601         }
 
505
<a name="l00602"></a>00602     }
 
506
<a name="l00603"></a>00603 }
 
507
<a name="l00604"></a>00604 
 
508
<a name="l00612"></a><a class="code" href="class_qwt_plot.html#44dc140e8503bb44da7921841f31051c">00612</a> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a> <a class="code" href="class_qwt_plot.html#44dc140e8503bb44da7921841f31051c">QwtPlot::canvasMap</a>(<span class="keywordtype">int</span> axisId)<span class="keyword"> const</span>
 
509
<a name="l00613"></a>00613 <span class="keyword"></span>{
 
510
<a name="l00614"></a>00614     <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a> map;
 
511
<a name="l00615"></a>00615     <span class="keywordflow">if</span> ( !d_data-&gt;canvas )
 
512
<a name="l00616"></a>00616         <span class="keywordflow">return</span> map;
 
513
<a name="l00617"></a>00617 
 
514
<a name="l00618"></a>00618     map.<a class="code" href="class_qwt_scale_map.html#37edc7ef45ce0958927f17ca96f91dde">setTransformation</a>(<a class="code" href="class_qwt_plot.html#619b65bb95090ab5a528e33a5014ae4f">axisScaleEngine</a>(axisId)-&gt;transformation());
 
515
<a name="l00619"></a>00619 
 
516
<a name="l00620"></a>00620     <span class="keyword">const</span> <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> *sd = <a class="code" href="class_qwt_plot.html#029086e7b26fcfeff5430d25a4df4f3e">axisScaleDiv</a>(axisId);
 
517
<a name="l00621"></a>00621     map.<a class="code" href="class_qwt_scale_map.html#aa33bc8e1aed7aa17d345053194e7094">setScaleInterval</a>(sd-&gt;<a class="code" href="class_qwt_scale_div.html#df5e9211cd42a3efc1a3cdf836dc741a">lBound</a>(), sd-&gt;<a class="code" href="class_qwt_scale_div.html#8c6238cf9e8f406e9633fcede305e33c">hBound</a>());
 
518
<a name="l00622"></a>00622 
 
519
<a name="l00623"></a>00623     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#a6d08ba153cb46662692611b5c38bbe0">axisEnabled</a>(axisId) )
 
520
<a name="l00624"></a>00624     {
 
521
<a name="l00625"></a>00625         <span class="keyword">const</span> <a class="code" href="class_qwt_scale_widget.html">QwtScaleWidget</a> *s = <a class="code" href="class_qwt_plot.html#8436c30175884d7643d68fd0dd236cd8">axisWidget</a>(axisId);
 
522
<a name="l00626"></a>00626         <span class="keywordflow">if</span> ( axisId == yLeft || axisId == yRight )
 
523
<a name="l00627"></a>00627         {
 
524
<a name="l00628"></a>00628             <span class="keywordtype">int</span> y = s-&gt;y() + s-&gt;<a class="code" href="class_qwt_scale_widget.html#000a9be0eede5f43c938963ebba62305">startBorderDist</a>() - d_data-&gt;canvas-&gt;y();
 
525
<a name="l00629"></a>00629             <span class="keywordtype">int</span> h = s-&gt;height() - s-&gt;<a class="code" href="class_qwt_scale_widget.html#000a9be0eede5f43c938963ebba62305">startBorderDist</a>() - s-&gt;<a class="code" href="class_qwt_scale_widget.html#76a5e92a7b138238a8e0b7288842f9c8">endBorderDist</a>();
 
526
<a name="l00630"></a>00630             map.<a class="code" href="class_qwt_scale_map.html#a9a63a0b2e4ff81b1df23d9f968cd5b8">setPaintInterval</a>(y + h, y);
 
527
<a name="l00631"></a>00631         }
 
528
<a name="l00632"></a>00632         <span class="keywordflow">else</span>
 
529
<a name="l00633"></a>00633         {
 
530
<a name="l00634"></a>00634             <span class="keywordtype">int</span> x = s-&gt;x() + s-&gt;<a class="code" href="class_qwt_scale_widget.html#000a9be0eede5f43c938963ebba62305">startBorderDist</a>() - d_data-&gt;canvas-&gt;x();
 
531
<a name="l00635"></a>00635             <span class="keywordtype">int</span> w = s-&gt;width() - s-&gt;<a class="code" href="class_qwt_scale_widget.html#000a9be0eede5f43c938963ebba62305">startBorderDist</a>() - s-&gt;<a class="code" href="class_qwt_scale_widget.html#76a5e92a7b138238a8e0b7288842f9c8">endBorderDist</a>();
 
532
<a name="l00636"></a>00636             map.<a class="code" href="class_qwt_scale_map.html#a9a63a0b2e4ff81b1df23d9f968cd5b8">setPaintInterval</a>(x, x + w);
 
533
<a name="l00637"></a>00637         }
 
534
<a name="l00638"></a>00638     }
 
535
<a name="l00639"></a>00639     <span class="keywordflow">else</span>
 
536
<a name="l00640"></a>00640     {
 
537
<a name="l00641"></a>00641         <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a1cd0fa079f2057df3ddb33355bf9536">margin</a> = <a class="code" href="class_qwt_plot.html#9156b14a6f67f6279a16fea063ce1d14">plotLayout</a>()-&gt;<a class="code" href="class_qwt_plot_layout.html#1cf0064eb5a13e05c6db530c9269728d">canvasMargin</a>(axisId);
 
538
<a name="l00642"></a>00642 
 
539
<a name="l00643"></a>00643         <span class="keyword">const</span> QRect &amp;canvasRect = d_data-&gt;canvas-&gt;contentsRect();
 
540
<a name="l00644"></a>00644         <span class="keywordflow">if</span> ( axisId == yLeft || axisId == yRight )
 
541
<a name="l00645"></a>00645         {
 
542
<a name="l00646"></a>00646             map.<a class="code" href="class_qwt_scale_map.html#a9a63a0b2e4ff81b1df23d9f968cd5b8">setPaintInterval</a>(canvasRect.bottom() - margin, 
 
543
<a name="l00647"></a>00647                 canvasRect.top() + margin);
 
544
<a name="l00648"></a>00648         }
 
545
<a name="l00649"></a>00649         <span class="keywordflow">else</span>
 
546
<a name="l00650"></a>00650         {
 
547
<a name="l00651"></a>00651             map.<a class="code" href="class_qwt_scale_map.html#a9a63a0b2e4ff81b1df23d9f968cd5b8">setPaintInterval</a>(canvasRect.left() + margin, 
 
548
<a name="l00652"></a>00652                 canvasRect.right() - margin);
 
549
<a name="l00653"></a>00653         }
 
550
<a name="l00654"></a>00654     }
 
551
<a name="l00655"></a>00655     <span class="keywordflow">return</span> map;
 
552
<a name="l00656"></a>00656 }
 
553
<a name="l00657"></a>00657 
 
554
<a name="l00665"></a><a class="code" href="class_qwt_plot.html#26f01ba1c3c85308db6cac67c5f1159c">00665</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#26f01ba1c3c85308db6cac67c5f1159c">QwtPlot::setMargin</a>(<span class="keywordtype">int</span> margin)
 
555
<a name="l00666"></a>00666 {
 
556
<a name="l00667"></a>00667     <span class="keywordflow">if</span> ( margin &lt; 0 )
 
557
<a name="l00668"></a>00668         margin = 0;
 
558
<a name="l00669"></a>00669 
 
559
<a name="l00670"></a>00670     <span class="keywordflow">if</span> ( margin != d_data-&gt;layout-&gt;margin() )
 
560
<a name="l00671"></a>00671     {
 
561
<a name="l00672"></a>00672         d_data-&gt;layout-&gt;setMargin(margin);
 
562
<a name="l00673"></a>00673         <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
563
<a name="l00674"></a>00674     }
 
564
<a name="l00675"></a>00675 }
 
565
<a name="l00676"></a>00676 
 
566
<a name="l00681"></a><a class="code" href="class_qwt_plot.html#a1cd0fa079f2057df3ddb33355bf9536">00681</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a1cd0fa079f2057df3ddb33355bf9536">QwtPlot::margin</a>()<span class="keyword"> const</span>
 
567
<a name="l00682"></a>00682 <span class="keyword"></span>{
 
568
<a name="l00683"></a>00683     <span class="keywordflow">return</span> d_data-&gt;layout-&gt;margin();
 
569
<a name="l00684"></a>00684 }
 
570
<a name="l00685"></a>00685 
 
571
<a name="l00694"></a><a class="code" href="class_qwt_plot.html#1a56902d2109fcf709ad1dbd35f0b859">00694</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)
 
572
<a name="l00695"></a>00695 {
 
573
<a name="l00696"></a>00696     QPalette p = d_data-&gt;canvas-&gt;palette();
 
574
<a name="l00697"></a>00697 
 
575
<a name="l00698"></a>00698     <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; QPalette::NColorGroups; i++ )
 
576
<a name="l00699"></a>00699     {
 
577
<a name="l00700"></a>00700 #<span class="keywordflow">if</span> QT_VERSION &lt; 0x040000
 
578
<a name="l00701"></a>00701         p.setColor((QPalette::ColorGroup)i, QColorGroup::Background, c);
 
579
<a name="l00702"></a>00702 <span class="preprocessor">#else</span>
 
580
<a name="l00703"></a>00703 <span class="preprocessor"></span>        p.setColor((QPalette::ColorGroup)i, QPalette::Background, c);
 
581
<a name="l00704"></a>00704 <span class="preprocessor">#endif</span>
 
582
<a name="l00705"></a>00705 <span class="preprocessor"></span>    }
 
583
<a name="l00706"></a>00706 
 
584
<a name="l00707"></a>00707     <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;setPalette(p);
 
585
<a name="l00708"></a>00708 }
 
586
<a name="l00709"></a>00709 
 
587
<a name="l00716"></a><a class="code" href="class_qwt_plot.html#0094df4164c97de505e3dc6ad7be3385">00716</a> <span class="keyword">const</span> QColor &amp; <a class="code" href="class_qwt_plot.html#0094df4164c97de505e3dc6ad7be3385">QwtPlot::canvasBackground</a>()<span class="keyword"> const</span>
 
588
<a name="l00717"></a>00717 <span class="keyword"></span>{
 
589
<a name="l00718"></a>00718 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
 
590
<a name="l00719"></a>00719 <span class="preprocessor"></span>    <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;palette().color(
 
591
<a name="l00720"></a>00720         QPalette::Normal, QColorGroup::Background);
 
592
<a name="l00721"></a>00721 <span class="preprocessor">#else</span>
 
593
<a name="l00722"></a>00722 <span class="preprocessor"></span>    <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;palette().color(
 
594
<a name="l00723"></a>00723         QPalette::Normal, QPalette::Background);
 
595
<a name="l00724"></a>00724 <span class="preprocessor">#endif</span>
 
596
<a name="l00725"></a>00725 <span class="preprocessor"></span>}
 
597
<a name="l00726"></a>00726 
 
598
<a name="l00733"></a><a class="code" href="class_qwt_plot.html#5af96e90be286753d524bdb042917618">00733</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#5af96e90be286753d524bdb042917618">QwtPlot::setCanvasLineWidth</a>(<span class="keywordtype">int</span> w)
 
599
<a name="l00734"></a>00734 {
 
600
<a name="l00735"></a>00735     <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;setLineWidth(w);
 
601
<a name="l00736"></a>00736     <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
602
<a name="l00737"></a>00737 }
 
603
<a name="l00738"></a>00738  
 
604
<a name="l00744"></a><a class="code" href="class_qwt_plot.html#d310af5a2b55bfc8b064c70afc8eb5e8">00744</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#d310af5a2b55bfc8b064c70afc8eb5e8">QwtPlot::canvasLineWidth</a>()<span class="keyword"> const</span>
 
605
<a name="l00745"></a>00745 <span class="keyword"></span>{ 
 
606
<a name="l00746"></a>00746     <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot.html#afcc82150034fbeb393ceb9f54ba2f1a">canvas</a>()-&gt;lineWidth();
 
607
<a name="l00747"></a>00747 }
 
608
<a name="l00748"></a>00748 
 
609
<a name="l00753"></a><a class="code" href="class_qwt_plot.html#c02c033b024a4ecbefcf1b0e93c91205">00753</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#c02c033b024a4ecbefcf1b0e93c91205">QwtPlot::axisValid</a>(<span class="keywordtype">int</span> axisId)
 
610
<a name="l00754"></a>00754 {
 
611
<a name="l00755"></a>00755     <span class="keywordflow">return</span> ((axisId &gt;= QwtPlot::yLeft) &amp;&amp; (axisId &lt; QwtPlot::axisCnt));
 
612
<a name="l00756"></a>00756 }
 
613
<a name="l00757"></a>00757 
 
614
<a name="l00762"></a><a class="code" href="class_qwt_plot.html#e1b53fe373a12b1558fca37fdc2f0a54">00762</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#e1b53fe373a12b1558fca37fdc2f0a54">QwtPlot::legendItemClicked</a>()
 
615
<a name="l00763"></a>00763 {
 
616
<a name="l00764"></a>00764     <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; sender()-&gt;isWidgetType() )
 
617
<a name="l00765"></a>00765     {
 
618
<a name="l00766"></a>00766         <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a> *plotItem = 
 
619
<a name="l00767"></a>00767             (<a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a>*)d_data-&gt;legend-&gt;find((QWidget *)sender());
 
620
<a name="l00768"></a>00768         <span class="keywordflow">if</span> ( plotItem )
 
621
<a name="l00769"></a>00769             emit <a class="code" href="class_qwt_plot.html#52b75d5548fbe04539b6297de53a2222">legendClicked</a>(plotItem);
 
622
<a name="l00770"></a>00770     }
 
623
<a name="l00771"></a>00771 }
 
624
<a name="l00772"></a>00772 
 
625
<a name="l00777"></a><a class="code" href="class_qwt_plot.html#d41768a65a7cc426091c89d54e3c2ab2">00777</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#d41768a65a7cc426091c89d54e3c2ab2">QwtPlot::legendItemChecked</a>(<span class="keywordtype">bool</span> on)
 
626
<a name="l00778"></a>00778 {
 
627
<a name="l00779"></a>00779     <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; sender()-&gt;isWidgetType() )
 
628
<a name="l00780"></a>00780     {
 
629
<a name="l00781"></a>00781         <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a> *plotItem = 
 
630
<a name="l00782"></a>00782             (<a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a>*)d_data-&gt;legend-&gt;find((QWidget *)sender());
 
631
<a name="l00783"></a>00783         <span class="keywordflow">if</span> ( plotItem )
 
632
<a name="l00784"></a>00784             emit <a class="code" href="class_qwt_plot.html#bd9e17629dd7c142fed017ea5e347149">legendChecked</a>(plotItem, on);
 
633
<a name="l00785"></a>00785     }
 
634
<a name="l00786"></a>00786 }
 
635
<a name="l00787"></a>00787 
 
636
<a name="l00789"></a><a class="code" href="class_qwt_plot.html#e2191d8ad33164b83aa2a14563f132a5">00789</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#e2191d8ad33164b83aa2a14563f132a5">QwtPlot::clear</a>()
 
637
<a name="l00790"></a>00790 {
 
638
<a name="l00791"></a>00791     <a class="code" href="class_qwt_plot_dict.html#cb2e402e05c693433ed7e84696fbdfc0">detachItems</a>(QwtPlotItem::Rtti_PlotCurve);
 
639
<a name="l00792"></a>00792     <a class="code" href="class_qwt_plot_dict.html#cb2e402e05c693433ed7e84696fbdfc0">detachItems</a>(QwtPlotItem::Rtti_PlotMarker);
 
640
<a name="l00793"></a>00793 }
 
641
<a name="l00794"></a>00794 
 
642
<a name="l00822"></a><a class="code" href="class_qwt_plot.html#6e23cad2bce7b04a09f18fa139341d5c">00822</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, 
 
643
<a name="l00823"></a>00823     <a class="code" href="class_qwt_plot.html#31aacb65b5c049dde8c34a0d8482661b">QwtPlot::LegendPosition</a> pos, <span class="keywordtype">double</span> ratio)
 
644
<a name="l00824"></a>00824 {
 
645
<a name="l00825"></a>00825     d_data-&gt;layout-&gt;setLegendPosition(pos, ratio);
 
646
<a name="l00826"></a>00826 
 
647
<a name="l00827"></a>00827     <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">legend</a> != d_data-&gt;legend )
 
648
<a name="l00828"></a>00828     {
 
649
<a name="l00829"></a>00829         <span class="keywordflow">if</span> ( d_data-&gt;legend &amp;&amp; d_data-&gt;legend-&gt;parent() == this )
 
650
<a name="l00830"></a>00830             <span class="keyword">delete</span> d_data-&gt;legend;
 
651
<a name="l00831"></a>00831 
 
652
<a name="l00832"></a>00832         d_data-&gt;legend = <a class="code" href="class_qwt_plot.html#ab1f2cf0e567e09a4c4bce3181c03ba0">legend</a>;
 
653
<a name="l00833"></a>00833 
 
654
<a name="l00834"></a>00834         if ( d_data-&gt;legend )
 
655
<a name="l00835"></a>00835         {
 
656
<a name="l00836"></a>00836             <span class="keywordflow">if</span> ( pos != ExternalLegend )
 
657
<a name="l00837"></a>00837             {
 
658
<a name="l00838"></a>00838                 <span class="keywordflow">if</span> ( d_data-&gt;legend-&gt;parent() != this )
 
659
<a name="l00839"></a>00839                 {
 
660
<a name="l00840"></a>00840 #<span class="keywordflow">if</span> QT_VERSION &lt; 0x040000
 
661
<a name="l00841"></a>00841                     d_data-&gt;legend-&gt;reparent(<span class="keyword">this</span>, QPoint(0, 0));
 
662
<a name="l00842"></a>00842 <span class="preprocessor">#else</span>
 
663
<a name="l00843"></a>00843 <span class="preprocessor"></span>                    d_data-&gt;legend-&gt;setParent(<span class="keyword">this</span>);
 
664
<a name="l00844"></a>00844 <span class="preprocessor">#endif</span>
 
665
<a name="l00845"></a>00845 <span class="preprocessor"></span>                }
 
666
<a name="l00846"></a>00846             }
 
667
<a name="l00847"></a>00847 
 
668
<a name="l00848"></a>00848             <span class="keyword">const</span> <a class="code" href="qwt__plot__dict_8h.html#375ca32f3e8a24c8eeb076a637ecd1d8">QwtPlotItemList</a>&amp; itmList = <a class="code" href="class_qwt_plot_dict.html#49d60b01e53a33423987aa80559449f9">itemList</a>();
 
669
<a name="l00849"></a>00849             <span class="keywordflow">for</span> ( <a class="code" href="qwt__plot__dict_8h.html#e2ff587c6b81897fcff5c267c3a416e7">QwtPlotItemIterator</a> it = itmList.begin();
 
670
<a name="l00850"></a>00850                 it != itmList.end(); ++it )
 
671
<a name="l00851"></a>00851             {
 
672
<a name="l00852"></a>00852                 (*it)-&gt;updateLegend(d_data-&gt;legend);
 
673
<a name="l00853"></a>00853             }
 
674
<a name="l00854"></a>00854 
 
675
<a name="l00855"></a>00855             QLayout *l = d_data-&gt;legend-&gt;contentsWidget()-&gt;layout();
 
676
<a name="l00856"></a>00856             <span class="keywordflow">if</span> ( l &amp;&amp; l-&gt;inherits(<span class="stringliteral">"QwtDynGridLayout"</span>) )
 
677
<a name="l00857"></a>00857             {
 
678
<a name="l00858"></a>00858                 <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;
 
679
<a name="l00859"></a>00859                 <span class="keywordflow">switch</span>(d_data-&gt;layout-&gt;legendPosition())
 
680
<a name="l00860"></a>00860                 {
 
681
<a name="l00861"></a>00861                     <span class="keywordflow">case</span> LeftLegend:
 
682
<a name="l00862"></a>00862                     <span class="keywordflow">case</span> RightLegend:
 
683
<a name="l00863"></a>00863                         tl-&gt;setMaxCols(1); <span class="comment">// 1 column: align vertical</span>
 
684
<a name="l00864"></a>00864                         <span class="keywordflow">break</span>;
 
685
<a name="l00865"></a>00865                     <span class="keywordflow">case</span> TopLegend:
 
686
<a name="l00866"></a>00866                     <span class="keywordflow">case</span> BottomLegend:
 
687
<a name="l00867"></a>00867                         tl-&gt;setMaxCols(0); <span class="comment">// unlimited</span>
 
688
<a name="l00868"></a>00868                         <span class="keywordflow">break</span>;
 
689
<a name="l00869"></a>00869                     <span class="keywordflow">case</span> ExternalLegend:
 
690
<a name="l00870"></a>00870                         <span class="keywordflow">break</span>;
 
691
<a name="l00871"></a>00871                 }
 
692
<a name="l00872"></a>00872             }
 
693
<a name="l00873"></a>00873         }
 
694
<a name="l00874"></a>00874         <a class="code" href="class_qwt_plot.html#6455596162a69876a3504c0017531cf3">updateTabOrder</a>();
 
695
<a name="l00875"></a>00875     }
 
696
<a name="l00876"></a>00876 
 
697
<a name="l00877"></a>00877     <a class="code" href="class_qwt_plot.html#d470068832406086d6823109d8d7f050">updateLayout</a>();
 
698
<a name="l00878"></a>00878 }
 
699
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sat May 24 18:47:39 2008 for Qwt User's Guide by&nbsp;
 
700
<a href="http://www.doxygen.org/index.html">
 
701
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
 
702
</body>
 
703
</html>