11 #include <qpaintengine.h>
12 #include <qpainterpath.h>
25 class QwtNullPaintDevice::PaintEngine
QWT_FINAL :
public QPaintEngine
65 virtual
void drawImage(const QRectF&, const QImage&,
73 : QPaintEngine( QPaintEngine::AllFeatures )
77 bool QwtNullPaintDevice::PaintEngine::begin( QPaintDevice* )
83 bool QwtNullPaintDevice::PaintEngine::end()
99 void QwtNullPaintDevice::PaintEngine::drawRects(
100 const QRect* rects,
int rectCount)
103 if ( device == NULL )
108 QPaintEngine::drawRects( rects, rectCount );
115 void QwtNullPaintDevice::PaintEngine::drawRects(
116 const QRectF* rects,
int rectCount)
119 if ( device == NULL )
124 QPaintEngine::drawRects( rects, rectCount );
131 void QwtNullPaintDevice::PaintEngine::drawLines(
132 const QLine* lines,
int lineCount)
135 if ( device == NULL )
140 QPaintEngine::drawLines( lines, lineCount );
147 void QwtNullPaintDevice::PaintEngine::drawLines(
148 const QLineF* lines,
int lineCount)
151 if ( device == NULL )
156 QPaintEngine::drawLines( lines, lineCount );
163 void QwtNullPaintDevice::PaintEngine::drawEllipse(
167 if ( device == NULL )
172 QPaintEngine::drawEllipse( rect );
179 void QwtNullPaintDevice::PaintEngine::drawEllipse(
183 if ( device == NULL )
188 QPaintEngine::drawEllipse( rect );
196 void QwtNullPaintDevice::PaintEngine::drawPath(
197 const QPainterPath& path)
200 if ( device == NULL )
206 void QwtNullPaintDevice::PaintEngine::drawPoints(
207 const QPointF* points,
int pointCount)
210 if ( device == NULL )
215 QPaintEngine::drawPoints( points, pointCount );
222 void QwtNullPaintDevice::PaintEngine::drawPoints(
223 const QPoint* points,
int pointCount)
226 if ( device == NULL )
231 QPaintEngine::drawPoints( points, pointCount );
238 void QwtNullPaintDevice::PaintEngine::drawPolygon(
239 const QPointF* points,
int pointCount, PolygonDrawMode
mode)
242 if ( device == NULL )
249 if ( pointCount > 0 )
251 path.moveTo( points[0] );
252 for (
int i = 1; i < pointCount; i++ )
253 path.lineTo( points[i] );
255 if (
mode != PolylineMode )
266 void QwtNullPaintDevice::PaintEngine::drawPolygon(
267 const QPoint* points,
int pointCount, PolygonDrawMode
mode)
270 if ( device == NULL )
277 if ( pointCount > 0 )
279 path.moveTo( points[0] );
280 for (
int i = 1; i < pointCount; i++ )
281 path.lineTo( points[i] );
283 if (
mode != PolylineMode )
294 void QwtNullPaintDevice::PaintEngine::drawPixmap(
295 const QRectF& rect,
const QPixmap& pm,
const QRectF& subRect )
298 if ( device == NULL )
304 void QwtNullPaintDevice::PaintEngine::drawTextItem(
305 const QPointF& pos,
const QTextItem& textItem)
308 if ( device == NULL )
313 QPaintEngine::drawTextItem( pos, textItem );
320 void QwtNullPaintDevice::PaintEngine::drawTiledPixmap(
321 const QRectF& rect,
const QPixmap& pixmap,
322 const QPointF& subRect)
325 if ( device == NULL )
330 QPaintEngine::drawTiledPixmap( rect, pixmap, subRect );
337 void QwtNullPaintDevice::PaintEngine::drawImage(
338 const QRectF& rect,
const QImage& image,
339 const QRectF& subRect, Qt::ImageConversionFlags flags)
342 if ( device == NULL )
345 device->
drawImage( rect, image, subRect, flags );
348 void QwtNullPaintDevice::PaintEngine::updateState(
349 const QPaintEngineState& engineState)
352 if ( device == NULL )
426 switch ( deviceMetric )
448 case PdmPhysicalDpiX:
449 case PdmPhysicalDpiY:
458 value = qRound(
metric( PdmWidth ) * 25.4 /
metric( PdmDpiX ) );
463 value = qRound(
metric( PdmHeight ) * 25.4 /
metric( PdmDpiY ) );
475 const QRect* rects,
int rectCount)
483 const QRectF* rects,
int rectCount)
491 const QLine* lines,
int lineCount)
499 const QLineF* lines,
int lineCount)
525 const QPointF* points,
int pointCount)
528 Q_UNUSED(pointCount);
533 const QPoint* points,
int pointCount)
536 Q_UNUSED(pointCount);
541 const QPointF* points,
int pointCount,
542 QPaintEngine::PolygonDrawMode mode)
545 Q_UNUSED(pointCount);
551 const QPoint* points,
int pointCount,
552 QPaintEngine::PolygonDrawMode mode)
555 Q_UNUSED(pointCount);
561 const QPixmap& pm,
const QRectF& subRect )
570 const QPointF& pos,
const QTextItem& textItem)
578 const QRectF& rect,
const QPixmap& pixmap,
579 const QPointF& subRect)
588 const QRectF& rect,
const QImage& image,
589 const QRectF& subRect, Qt::ImageConversionFlags flags)
599 const QPaintEngineState&
state )