1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
|
<!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: qwt_plot_print.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>qwt_plot_print.cpp</h1><pre class="fragment"><div>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span>
00002 <span class="comment"> * Qwt Widget Library</span>
00003 <span class="comment"> * Copyright (C) 1997 Josef Wilgen</span>
00004 <span class="comment"> * Copyright (C) 2002 Uwe Rathmann</span>
00005 <span class="comment"> *</span>
00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
00008 <span class="comment"> *****************************************************************************/</span>
00009
00010 <span class="comment">// vim: expandtab</span>
00011
00012 <span class="preprocessor">#include <qlabel.h></span>
00013 <span class="preprocessor">#include <qpainter.h></span>
00014 <span class="preprocessor">#include <qpaintdevicemetrics.h></span>
00015 <span class="preprocessor">#include "qwt_painter.h"</span>
00016 <span class="preprocessor">#include "qwt_legend.h"</span>
00017 <span class="preprocessor">#include "qwt_plot.h"</span>
00018 <span class="preprocessor">#include "qwt_plot_layout.h"</span>
00019 <span class="preprocessor">#include "qwt_plot_dict.h"</span>
00020 <span class="preprocessor">#include "qwt_rect.h"</span>
00021 <span class="preprocessor">#include "qwt_dyngrid_layout.h"</span>
00022 <span class="preprocessor">#include "qwt_scale.h"</span>
00023 <span class="preprocessor">#include "qwt_text.h"</span>
00024 <span class="preprocessor">#include "<a class="code" href="qwt__math_8h.html">qwt_math.h</a>"</span>
00025
<a name="l00072"></a><a class="code" href="class_qwt_plot.html#a13">00072</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#a13">QwtPlot::print</a>(QPaintDevice &paintDev,
00073 <span class="keyword">const</span> <a class="code" href="class_qwt_plot_print_filter.html">QwtPlotPrintFilter</a> &pfilter)<span class="keyword"> const</span>
00074 <span class="keyword"></span>{
00075 QPaintDeviceMetrics mpr(&paintDev);
00076
00077 QRect rect(0, 0, mpr.width(), mpr.height());
00078 <span class="keywordtype">double</span> aspect = double(rect.width())/double(rect.height());
00079 <span class="keywordflow">if</span> ((aspect < 1.0))
00080 rect.setHeight(<span class="keywordtype">int</span>(aspect*rect.width()));
00081
00082 QPainter p(&paintDev);
00083 <a class="code" href="class_qwt_plot.html#a13">print</a>(&p, rect, pfilter);
00084 }
00085
<a name="l00095"></a><a class="code" href="class_qwt_plot.html#a14">00095</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#a13">QwtPlot::print</a>(QPainter *painter, <span class="keyword">const</span> QRect &plotRect,
00096 <span class="keyword">const</span> <a class="code" href="class_qwt_plot_print_filter.html">QwtPlotPrintFilter</a> &pfilter)<span class="keyword"> const</span>
00097 <span class="keyword"></span>{
00098 <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a109">axis</a>;
00099
00100 <span class="keywordflow">if</span> ( painter == 0 || !painter->isActive() ||
00101 !plotRect.isValid() || size().isNull() )
00102 <span class="keywordflow">return</span>;
00103
00104 painter->save();
00105
00106 <span class="comment">// All paint operations need to be scaled according to</span>
00107 <span class="comment">// the paint device metrics. </span>
00108
00109 <a class="code" href="class_qwt_painter.html#e0">QwtPainter::setMetricsMap</a>(<span class="keyword">this</span>, painter->device());
00110
00111 <span class="preprocessor">#if QT_VERSION < 300 </span>
00112 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( painter->device()->isExtDev() )
00113 {
00114 QPaintDeviceMetrics metrics(painter->device());
00115 <span class="keywordflow">if</span> ( metrics.logicalDpiX() == 72 && metrics.logicalDpiY() == 72 )
00116 {
00117 <span class="comment">// In Qt 2.x QPrinter returns hardcoded wrong metrics.</span>
00118 <span class="comment">// So scaling wont work: we reset to screen resolution</span>
00119
00120 <a class="code" href="class_qwt_painter.html#e0">QwtPainter::setMetricsMap</a>(<span class="keyword">this</span>, <span class="keyword">this</span>);
00121 }
00122 }
00123 <span class="preprocessor">#endif</span>
00124 <span class="preprocessor"></span>
00125 <span class="keyword">const</span> QwtMetricsMap &metricsMap = <a class="code" href="class_qwt_painter.html#e3">QwtPainter::metricsMap</a>();
00126
00127 <span class="comment">// It is almost impossible to integrate into the Qt layout</span>
00128 <span class="comment">// framework, when using different fonts for printing</span>
00129 <span class="comment">// and screen. To avoid writing different and Qt unconform</span>
00130 <span class="comment">// layout engines we change the widget attributes, print and </span>
00131 <span class="comment">// reset the widget attributes again. This way we produce a lot of</span>
00132 <span class="comment">// useless layout events ...</span>
00133
00134 pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a6">apply</a>((<a class="code" href="class_qwt_plot.html">QwtPlot</a> *)<span class="keyword">this</span>);
00135
00136 <span class="keywordtype">int</span> baseLineDists[QwtPlot::axisCnt];
00137 <span class="keywordflow">if</span> ( !(pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintCanvasBackground) )
00138 {
00139 <span class="comment">// In case of no background we set the backbone of</span>
00140 <span class="comment">// the scale on the frame of the canvas.</span>
00141
00142 <span class="keywordflow">for</span> (axis = 0; axis < QwtPlot::axisCnt; axis++ )
00143 {
00144 <span class="keywordflow">if</span> ( d_scale[axis] )
00145 {
00146 baseLineDists[axis] = d_scale[axis]-><a class="code" href="class_qwt_scale.html#a16">baseLineDist</a>();
00147 d_scale[axis]->setBaselineDist(0);
00148 }
00149 }
00150 }
00151 <span class="comment">// Calculate the layout for the print.</span>
00152
00153 <span class="keywordtype">int</span> layoutOptions = QwtPlotLayout::IgnoreScrollbars
00154 | QwtPlotLayout::IgnoreFrames | QwtPlotLayout::AlignScales;
00155 <span class="keywordflow">if</span> ( !(pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintMargin) )
00156 layoutOptions |= QwtPlotLayout::IgnoreMargin;
00157 <span class="keywordflow">if</span> ( !(pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintLegend) )
00158 layoutOptions |= QwtPlotLayout::IgnoreLegend;
00159
00160 d_layout-><a class="code" href="class_qwt_plot_layout.html#a18">activate</a>(<span class="keyword">this</span>, QwtPainter::metricsMap().deviceToLayout(plotRect),
00161 layoutOptions);
00162
00163 <span class="keywordflow">if</span> ((pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintTitle)
00164 && (!d_lblTitle->text().isEmpty()))
00165 {
00166 <a class="code" href="class_qwt_plot.html#b12">printTitle</a>(painter, d_layout-><a class="code" href="class_qwt_plot_layout.html#a20">titleRect</a>());
00167 }
00168
00169 <span class="keywordflow">if</span> ( (pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintLegend)
00170 && !d_legend-><a class="code" href="class_qwt_legend.html#a15">isEmpty</a>() )
00171 {
00172 <a class="code" href="class_qwt_plot.html#b15">printLegend</a>(painter, d_layout-><a class="code" href="class_qwt_plot_layout.html#a21">legendRect</a>());
00173 }
00174
00175 <span class="keywordflow">for</span> ( axis = 0; axis < QwtPlot::axisCnt; axis++ )
00176 {
00177 <span class="keywordflow">if</span> (d_scale[axis])
00178 {
00179 <span class="keywordtype">int</span> baseDist = d_scale[axis]-><a class="code" href="class_qwt_scale.html#a16">baseLineDist</a>();
00180
00181 <span class="keywordtype">int</span> startDist, endDist;
00182 d_scale[axis]->minBorderDist(startDist, endDist);
00183
00184 <a class="code" href="class_qwt_plot.html#b13">printScale</a>(painter, axis, startDist, endDist,
00185 baseDist, d_layout-><a class="code" href="class_qwt_plot_layout.html#a22">scaleRect</a>(axis));
00186 }
00187 }
00188
00189 <span class="keyword">const</span> QRect canvasRect = metricsMap.layoutToDevice(d_layout-><a class="code" href="class_qwt_plot_layout.html#a23">canvasRect</a>());
00190
00191 <span class="comment">// When using QwtPainter all sizes where computed in pixel</span>
00192 <span class="comment">// coordinates and scaled by QwtPainter later. This limits</span>
00193 <span class="comment">// the precision to screen resolution. A much better solution</span>
00194 <span class="comment">// is to scale the maps and print in unlimited resolution.</span>
00195
00196 QwtArray<QwtDiMap> map(axisCnt);
00197 <span class="keywordflow">for</span> (axis = 0; axis < axisCnt; axis++)
00198 {
00199 <span class="keyword">const</span> <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> &scaleDiv = d_as[axis].<a class="code" href="class_qwt_auto_scale.html#a20">scaleDiv</a>();
00200 map[axis].setDblRange(scaleDiv.<a class="code" href="class_qwt_scale_div.html#a3">lBound</a>(),
00201 scaleDiv.<a class="code" href="class_qwt_scale_div.html#a4">hBound</a>(), scaleDiv.<a class="code" href="class_qwt_scale_div.html#a7">logScale</a>());
00202
00203 <span class="keywordtype">double</span> from, to;
00204 <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_plot.html#a97">axisEnabled</a>(axis) )
00205 {
00206 <span class="keyword">const</span> <span class="keywordtype">int</span> sDist = d_scale[axis]-><a class="code" href="class_qwt_scale.html#a12">startBorderDist</a>();
00207 <span class="keyword">const</span> <span class="keywordtype">int</span> eDist = d_scale[axis]->endBorderDist();
00208 <span class="keyword">const</span> QRect &scaleRect = d_layout-><a class="code" href="class_qwt_plot_layout.html#a22">scaleRect</a>(axis);
00209
00210 <span class="keywordflow">if</span> ( axis == xTop || axis == xBottom )
00211 {
00212 from = metricsMap.layoutToDeviceX(scaleRect.left() + sDist);
00213 to = metricsMap.layoutToDeviceX(scaleRect.right() - eDist);
00214 }
00215 <span class="keywordflow">else</span>
00216 {
00217 from = metricsMap.layoutToDeviceY(scaleRect.bottom() - sDist);
00218 to = metricsMap.layoutToDeviceY(scaleRect.top() + eDist);
00219 }
00220 }
00221 <span class="keywordflow">else</span>
00222 {
00223 <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a24">margin</a> = <a class="code" href="class_qwt_plot.html#a21">plotLayout</a>()-><a class="code" href="class_qwt_plot_layout.html#a5">canvasMargin</a>(axis);
00224
00225 <span class="keyword">const</span> QRect &canvasRect = <a class="code" href="class_qwt_plot.html#a21">plotLayout</a>()-><a class="code" href="class_qwt_plot_layout.html#a23">canvasRect</a>();
00226 <span class="keywordflow">if</span> ( axis == yLeft || axis == yRight )
00227 {
00228 from = metricsMap.layoutToDeviceX(canvasRect.bottom() - margin);
00229 to = metricsMap.layoutToDeviceX(canvasRect.top() + margin);
00230 }
00231 <span class="keywordflow">else</span>
00232 {
00233 from = metricsMap.layoutToDeviceY(canvasRect.left() + margin);
00234 to = metricsMap.layoutToDeviceY(canvasRect.right() - margin);
00235 }
00236 }
00237 map[axis].setIntRange( qwtInt(from), qwtInt(to));
00238 }
00239
00240
00241 <span class="comment">// The maps are already scaled. </span>
00242 <a class="code" href="class_qwt_painter.html#e0">QwtPainter::setMetricsMap</a>(painter->device(), painter->device());
00243
00244 <a class="code" href="class_qwt_plot.html#b14">printCanvas</a>(painter, canvasRect, map, pfilter);
00245
00246 <a class="code" href="class_qwt_painter.html#e2">QwtPainter::resetMetricsMap</a>();
00247
00248 d_layout-><a class="code" href="class_qwt_plot_layout.html#a19">invalidate</a>();
00249
00250 <span class="comment">// reset all widgets with their original attributes.</span>
00251 <span class="keywordflow">if</span> ( !(pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintCanvasBackground) )
00252 {
00253 <span class="comment">// restore the previous base line dists</span>
00254
00255 <span class="keywordflow">for</span> (axis = 0; axis < QwtPlot::axisCnt; axis++ )
00256 {
00257 <span class="keywordflow">if</span> ( d_scale[axis] )
00258 d_scale[axis]-><a class="code" href="class_qwt_scale.html#a15">setBaselineDist</a>(baseLineDists[axis]);
00259 }
00260 }
00261
00262 pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a7">reset</a>((<a class="code" href="class_qwt_plot.html">QwtPlot</a> *)<span class="keyword">this</span>);
00263
00264 painter->restore();
00265 }
00266
<a name="l00274"></a><a class="code" href="class_qwt_plot.html#b12">00274</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#b12">QwtPlot::printTitle</a>(QPainter *painter, <span class="keyword">const</span> QRect &rect)<span class="keyword"> const</span>
00275 <span class="keyword"></span>{
00276 <a class="code" href="class_qwt_text.html">QwtText</a> *text = <a class="code" href="class_qwt_text.html#e0">QwtText::makeText</a>(
00277 d_lblTitle->text(), d_lblTitle->textFormat(),
00278 d_lblTitle->alignment(), d_lblTitle->font(),
00279 d_lblTitle->palette().color(
00280 QPalette::Active, QColorGroup::Foreground));
00281
00282 text-><a class="code" href="class_qwt_text.html#a18">draw</a>(painter, rect);
00283 <span class="keyword">delete</span> text;
00284 }
00285
<a name="l00293"></a><a class="code" href="class_qwt_plot.html#b15">00293</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#b15">QwtPlot::printLegend</a>(QPainter *painter, <span class="keyword">const</span> QRect &rect)<span class="keyword"> const</span>
00294 <span class="keyword"></span>{
00295 <span class="keywordflow">if</span> ( !d_legend || d_legend-><a class="code" href="class_qwt_legend.html#a15">isEmpty</a>() )
00296 <span class="keywordflow">return</span>;
00297
00298 QLayout *l = d_legend-><a class="code" href="class_qwt_legend.html#a6">contentsWidget</a>()->layout();
00299 <span class="keywordflow">if</span> ( l == 0 || !l->inherits(<span class="stringliteral">"QwtDynGridLayout"</span>) )
00300 <span class="keywordflow">return</span>;
00301
00302 <a class="code" href="class_qwt_dyn_grid_layout.html">QwtDynGridLayout</a> *legendLayout = (<a class="code" href="class_qwt_dyn_grid_layout.html">QwtDynGridLayout</a> *)l;
00303
00304 uint numCols = legendLayout-><a class="code" href="class_qwt_dyn_grid_layout.html#a20">columnsForWidth</a>(rect.width());
00305 QValueList<QRect> itemRects =
00306 legendLayout-><a class="code" href="class_qwt_dyn_grid_layout.html#a21">layoutItems</a>(rect, numCols);
00307
00308 <span class="keywordtype">int</span> index = 0;
00309
00310 QLayoutIterator layoutIterator = legendLayout-><a class="code" href="class_qwt_dyn_grid_layout.html#a10">iterator</a>();
00311 <span class="keywordflow">for</span> ( QLayoutItem *item = layoutIterator.current();
00312 item != 0; item = ++layoutIterator)
00313 {
00314 QWidget *w = item->widget();
00315 <span class="keywordflow">if</span> ( w )
00316 {
00317 painter->save();
00318 painter->setClipping(TRUE);
00319 <a class="code" href="class_qwt_painter.html#e6">QwtPainter::setClipRect</a>(painter, itemRects[index]);
00320
00321 <a class="code" href="class_qwt_plot.html#b10">printLegendItem</a>(painter, w, itemRects[index]);
00322
00323 index++;
00324 painter->restore();
00325 }
00326 }
00327 }
00328
<a name="l00337"></a><a class="code" href="class_qwt_plot.html#b10">00337</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#b10">QwtPlot::printLegendItem</a>(QPainter *painter,
00338 <span class="keyword">const</span> QWidget *w, <span class="keyword">const</span> QRect &rect)<span class="keyword"> const</span>
00339 <span class="keyword"></span>{
00340 <span class="keyword">const</span> <a class="code" href="class_qwt_legend_item.html">QwtLegendItem</a> *item = NULL;
00341
00342 <span class="keywordflow">if</span> ( w->inherits(<span class="stringliteral">"QwtLegendButton"</span>) )
00343 item = (<a class="code" href="class_qwt_legend_button.html">QwtLegendButton</a> *)w;
00344
00345 <span class="keywordflow">if</span> ( w->inherits(<span class="stringliteral">"QwtLegendLabel"</span>) )
00346 item = (<a class="code" href="class_qwt_legend_label.html">QwtLegendLabel</a> *)w;
00347
00348 <span class="keywordflow">if</span> ( item )
00349 {
00350 painter->setFont(w->font());
00351 item-><a class="code" href="class_qwt_legend_item.html#a10">drawItem</a>(painter, rect);
00352 }
00353 }
00354
<a name="l00367"></a><a class="code" href="class_qwt_plot.html#b13">00367</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#b13">QwtPlot::printScale</a>(QPainter *painter,
00368 <span class="keywordtype">int</span> axis, <span class="keywordtype">int</span> startDist, <span class="keywordtype">int</span> endDist, <span class="keywordtype">int</span> baseDist,
00369 <span class="keyword">const</span> QRect &rect)<span class="keyword"> const</span>
00370 <span class="keyword"></span>{
00371 <span class="keywordflow">if</span> (!d_axisEnabled[axis])
00372 <span class="keywordflow">return</span>;
00373
00374 QwtScaleDraw::Orientation o;
00375 <span class="keywordtype">int</span> x, y, w;
00376
00377 <span class="keywordflow">switch</span>(axis)
00378 {
00379 <span class="keywordflow">case</span> yLeft:
00380 {
00381 x = rect.right() - baseDist;
00382 y = rect.y() + startDist;
00383 w = rect.height() - startDist - endDist;
00384 o = QwtScaleDraw::Left;
00385 <span class="keywordflow">break</span>;
00386 }
00387 <span class="keywordflow">case</span> yRight:
00388 {
00389 x = rect.left() + baseDist;
00390 y = rect.y() + startDist;
00391 w = rect.height() - startDist - endDist;
00392 o = QwtScaleDraw::Right;
00393 <span class="keywordflow">break</span>;
00394 }
00395 <span class="keywordflow">case</span> xTop:
00396 {
00397 x = rect.left() + startDist;
00398 y = rect.bottom() - baseDist;
00399 w = rect.width() - startDist - endDist;
00400 o = QwtScaleDraw::Top;
00401 <span class="keywordflow">break</span>;
00402 }
00403 <span class="keywordflow">case</span> xBottom:
00404 {
00405 x = rect.left() + startDist;
00406 y = rect.top() + baseDist;
00407 w = rect.width() - startDist - endDist;
00408 o = QwtScaleDraw::Bottom;
00409 <span class="keywordflow">break</span>;
00410 }
00411 <span class="keywordflow">default</span>:
00412 <span class="keywordflow">return</span>;
00413 }
00414
00415 <span class="keyword">const</span> <a class="code" href="class_qwt_scale.html">QwtScale</a> *scale = d_scale[axis];
00416 scale-><a class="code" href="class_qwt_scale.html#a31">drawTitle</a>(painter, o, rect);
00417
00418 painter->save();
00419 QPen pen(painter->pen());
00420 pen.setColor(
00421 scale->palette().color(QPalette::Active, QColorGroup::Foreground));
00422 painter->setPen(pen);
00423 painter->setFont(scale->font());
00424
00425 <a class="code" href="class_qwt_scale_draw.html">QwtScaleDraw</a> *sd = (<a class="code" href="class_qwt_scale_draw.html">QwtScaleDraw</a> *)scale-><a class="code" href="class_qwt_scale.html#a21">scaleDraw</a>();
00426 <span class="keywordtype">int</span> xSd = sd-><a class="code" href="class_qwt_scale_draw.html#a7">x</a>();
00427 <span class="keywordtype">int</span> ySd = sd-><a class="code" href="class_qwt_scale_draw.html#a8">y</a>();
00428 <span class="keywordtype">int</span> lengthSd = sd-><a class="code" href="class_qwt_scale_draw.html#a9">length</a>();
00429
00430 sd-><a class="code" href="class_qwt_scale_draw.html#a6">setGeometry</a>(x, y, w, o);
00431 sd-><a class="code" href="class_qwt_scale_draw.html#a29">draw</a>(painter);
00432 sd-><a class="code" href="class_qwt_scale_draw.html#a6">setGeometry</a>(xSd, ySd, lengthSd, o); <span class="comment">// reset previous values</span>
00433 painter->restore();
00434 }
00435
<a name="l00446"></a><a class="code" href="class_qwt_plot.html#b14">00446</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#b14">QwtPlot::printCanvas</a>(QPainter *painter, <span class="keyword">const</span> QRect &canvasRect,
00447 <span class="keyword">const</span> QwtArray<QwtDiMap> &map, <span class="keyword">const</span> <a class="code" href="class_qwt_plot_print_filter.html">QwtPlotPrintFilter</a> &pfilter)<span class="keyword"> const</span>
00448 <span class="keyword"></span>{
00449 <span class="keywordflow">if</span> ( pfilter.<a class="code" href="class_qwt_plot_print_filter.html#a5">options</a>() & QwtPlotPrintFilter::PrintCanvasBackground )
00450 {
00451 <a class="code" href="class_qwt_painter.html#e14">QwtPainter::fillRect</a>(painter, QRect(canvasRect.x(), canvasRect.y(),
00452 canvasRect.width() - 1, canvasRect.height() - 1),
00453 <a class="code" href="class_qwt_plot.html#a34">canvasBackground</a>());
00454 }
00455 <span class="keywordflow">else</span>
00456 <a class="code" href="class_qwt_painter.html#e12">QwtPainter::drawRect</a>(painter, canvasRect.x() - 1, canvasRect.y() - 1,
00457 canvasRect.width() + 1, canvasRect.height() + 1);
00458
00459 painter->setClipping(TRUE);
00460 <a class="code" href="class_qwt_painter.html#e6">QwtPainter::setClipRect</a>(painter, canvasRect);
00461
00462 <a class="code" href="class_qwt_plot.html#b2">drawCanvasItems</a>(painter, canvasRect, map, pfilter);
00463 }
00464
00465 <span class="comment">// Local Variables:</span>
00466 <span class="comment">// mode: C++</span>
00467 <span class="comment">// c-file-style: "stroustrup"</span>
00468 <span class="comment">// indent-tabs-mode: nil</span>
00469 <span class="comment">// End:</span>
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 16 21:12:21 2004 for Qwt User's Guide by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>
|