QGIS API Documentation 3.99.0-Master (26c88405ac0)
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
33 public:
34
35 QgsMaskPaintEngine( bool usePathStroker = false );
36
37 bool begin( QPaintDevice * ) override { return true; };
38 bool end() override { return true; };
39 QPaintEngine::Type type() const override { return QPaintEngine::User; };
40 void updateState( const QPaintEngineState & ) override { return; };
41
42 void drawPath( const QPainterPath & ) override;
43 void drawPolygon( const QPointF *, int, PolygonDrawMode ) override;
44 void drawPixmap( const QRectF &, const QPixmap &, const QRectF & ) override { return; };
45
46 QPainterPath maskPainterPath() const;
47
48 private:
49
50 bool mUsePathStroker = false;
51 QPainterPath mMaskPainterPath;
52
53};
55#endif
56
57
64class CORE_EXPORT QgsMaskPaintDevice: public QPaintDevice
65{
66
67 public:
68
75 Q_DECL_DEPRECATED QgsMaskPaintDevice( bool usePathStroker = false ) SIP_DEPRECATED;
76
77 QPaintEngine *paintEngine() const override;
78
79 int metric( PaintDeviceMetric metric ) const override;
80
86 Q_DECL_DEPRECATED QPainterPath maskPainterPath() const SIP_DEPRECATED;
87
88 private:
89
90 std::unique_ptr<QgsMaskPaintEngine> mPaintEngine;
91
92 QSize mSize;
93
94};
95
96
97#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:114