QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsmaskpaintdevice.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaskpaintdevice.h
3 --------------------------------------
4 Date : February 2022
5 Copyright : (C) 2022 by Julien Cabieces
6 Email : julien dot cabieces at oslandia dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMASKPAINTDEVICE_H
17#define QGSMASKPAINTDEVICE_H
18
19#include <memory>
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23
24#include <QPaintDevice>
25#include <QPaintEngine>
26#include <QPainterPath>
27
28#ifndef SIP_RUN
30class QgsMaskPaintEngine : public QPaintEngine
31{
32 public:
33 QgsMaskPaintEngine( bool usePathStroker = false );
34
35 bool begin( QPaintDevice * ) override { return true; };
36 bool end() override { return true; };
37 QPaintEngine::Type type() const override { return QPaintEngine::User; };
38 void updateState( const QPaintEngineState & ) override { return; };
39
40 void drawPath( const QPainterPath & ) override;
41 void drawPolygon( const QPointF *, int, PolygonDrawMode ) override;
42 void drawPixmap( const QRectF &, const QPixmap &, const QRectF & ) override { return; };
43
44 QPainterPath maskPainterPath() const;
45
46 private:
47 bool mUsePathStroker = false;
48 QPainterPath mMaskPainterPath;
49};
51#endif
52
53
60class CORE_EXPORT QgsMaskPaintDevice : public QPaintDevice
61{
62 public:
69 Q_DECL_DEPRECATED QgsMaskPaintDevice( bool usePathStroker = false ) SIP_DEPRECATED;
70
71 QPaintEngine *paintEngine() const override;
72
73 int metric( PaintDeviceMetric metric ) const override;
74
80 Q_DECL_DEPRECATED QPainterPath maskPainterPath() const SIP_DEPRECATED;
81
82 private:
83 std::unique_ptr<QgsMaskPaintEngine> mPaintEngine;
84
85 QSize mSize;
86};
87
88
89#endif // QGSMASKPAINTDEVICE_H
Q_DECL_DEPRECATED QgsMaskPaintDevice(bool usePathStroker=false)
Q_DECL_DEPRECATED QPainterPath maskPainterPath() const
Returns the mask painter path painted on this paint device.
int metric(PaintDeviceMetric metric) const override
QPaintEngine * paintEngine() const override
#define SIP_DEPRECATED
Definition qgis_sip.h:113