16 #ifndef QGSNULLPAINTERDEVICE_H
17 #define QGSNULLPAINTERDEVICE_H
19 #include "qgis_core.h"
22 #include <QPaintDevice>
23 #include <QPaintEngine>
29 class QgsNullPaintEngine:
public QPaintEngine
34 QgsNullPaintEngine() : QPaintEngine( QPaintEngine::AllFeatures ) {};
36 bool begin( QPaintDevice * )
override {
return true; };
37 bool end()
override {
return true; };
38 QPaintEngine::Type type()
const override {
return QPaintEngine::User; };
39 void updateState(
const QPaintEngineState & )
override {
return; };
41 void drawRects(
const QRect *,
int )
override {
return; };
42 void drawRects(
const QRectF *,
int )
override {
return; };
43 void drawLines(
const QLine *,
int )
override {
return; };
44 void drawLines(
const QLineF *,
int )
override {
return; };
45 void drawEllipse(
const QRectF & )
override {
return; };
46 void drawEllipse(
const QRect & )
override {
return; };
47 void drawPath(
const QPainterPath & )
override {
return; };
48 void drawPoints(
const QPointF *,
int )
override {
return; };
49 void drawPoints(
const QPoint *,
int )
override {
return; };
50 void drawPolygon(
const QPointF *,
int, PolygonDrawMode )
override {
return; };
51 void drawPolygon(
const QPoint *,
int, PolygonDrawMode )
override {
return; };
52 void drawPixmap(
const QRectF &,
const QPixmap &,
const QRectF & )
override {
return; };
53 void drawTextItem(
const QPointF &,
const QTextItem & )
override {
return; };
54 void drawTiledPixmap(
const QRectF &,
const QPixmap &,
const QPointF & )
override {
return; };
55 void drawImage(
const QRectF &,
const QImage &,
const QRectF &, Qt::ImageConversionFlags )
override {
return; };
74 QPaintEngine *paintEngine()
const override;
76 int metric( PaintDeviceMetric metric )
const override;
90 std::unique_ptr<QgsNullPaintEngine> mPaintEngine;
Null painter device that can be used for map renderer jobs which use custom painters.
void setOutputSize(const QSize &size)
Sets the size of the device in pixels.
void setOutputDpi(const int dpi)
Sets the dpi of the device.