QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgspainteffectwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspainteffectwidget.h
3 ----------------------
4 begin : January 2015
5 copyright : (C) 2015 by Nyall Dawson
6 email : nyall dot dawson at gmail.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 QGSPAINTEFFECTWIDGET_H
17#define QGSPAINTEFFECTWIDGET_H
18
19#include <QWidget>
20#include "qgis_sip.h"
21#include "qgis_gui.h"
22
23class QgsPaintEffect;
24class QgsShadowEffect;
26class QgsBlurEffect;
27class QgsGlowEffect;
29class QgsColorEffect;
30
31
39class GUI_EXPORT QgsPaintEffectWidget : public QWidget
40{
41 Q_OBJECT
42
43 public:
44 QgsPaintEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr ) : QWidget( parent ) {}
45
50 virtual void setPaintEffect( QgsPaintEffect *effect ) = 0;
51
52 signals:
53
57 void changed();
58
59};
60
61//individual effect widgets
62
63#include "ui_widget_drawsource.h"
64
69class GUI_EXPORT QgsDrawSourceWidget : public QgsPaintEffectWidget, private Ui::WidgetDrawSource
70{
71 Q_OBJECT
72
73 public:
74 QgsDrawSourceWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
75
77
78 void setPaintEffect( QgsPaintEffect *effect ) override;
79
80 private:
81 QgsDrawSourceEffect *mEffect = nullptr;
82
83 void initGui();
84 void blockSignals( bool block );
85
86 private slots:
87
88 void opacityChanged( double value );
89 void mDrawModeComboBox_currentIndexChanged( int index );
90 void mBlendCmbBx_currentIndexChanged( int index );
91
92};
93
94
95
96#include "ui_widget_blur.h"
97
102class GUI_EXPORT QgsBlurWidget : public QgsPaintEffectWidget, private Ui::WidgetBlur
103{
104 Q_OBJECT
105
106 public:
107 QgsBlurWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
108
110
111 void setPaintEffect( QgsPaintEffect *effect ) override;
112
113 private:
114 QgsBlurEffect *mEffect = nullptr;
115
116 void initGui();
117 void blockSignals( bool block );
118
119 private slots:
120
121 void mBlurTypeCombo_currentIndexChanged( int index );
122 void mBlurStrengthSpnBx_valueChanged( double value );
123 void mBlurUnitWidget_changed();
124 void opacityChanged( double value );
125 void mDrawModeComboBox_currentIndexChanged( int index );
126 void mBlendCmbBx_currentIndexChanged( int index );
127
128};
129
130
131
132#include "ui_widget_shadoweffect.h"
133
138class GUI_EXPORT QgsShadowEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetShadowEffect
139{
140 Q_OBJECT
141
142 public:
143 QgsShadowEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
144
146
147 void setPaintEffect( QgsPaintEffect *effect ) override;
148
149 private:
150 QgsShadowEffect *mEffect = nullptr;
151
152 void initGui();
153 void blockSignals( bool block );
154
155 private slots:
156 void mShadowOffsetAngleSpnBx_valueChanged( int value );
157 void mShadowOffsetAngleDial_valueChanged( int value );
158 void mShadowOffsetSpnBx_valueChanged( double value );
159 void mOffsetUnitWidget_changed();
160 void opacityChanged( double value );
161 void mShadowColorBtn_colorChanged( const QColor &color );
162 void mDrawModeComboBox_currentIndexChanged( int index );
163 void mShadowBlendCmbBx_currentIndexChanged( int index );
164 void mShadowRadiuSpnBx_valueChanged( double value );
165 void mBlurUnitWidget_changed();
166};
167
168
169#include "ui_widget_glow.h"
170
175class GUI_EXPORT QgsGlowWidget : public QgsPaintEffectWidget, private Ui::WidgetGlow
176{
177 Q_OBJECT
178
179 public:
180 QgsGlowWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
181
183
184 void setPaintEffect( QgsPaintEffect *effect ) override;
185
186 private:
187 QgsGlowEffect *mEffect = nullptr;
188
189 void initGui();
190 void blockSignals( bool block );
191
192 private slots:
193 void colorModeChanged();
194 void mSpreadSpnBx_valueChanged( double value );
195 void mSpreadUnitWidget_changed();
196 void opacityChanged( double value );
197 void mColorBtn_colorChanged( const QColor &color );
198 void mBlendCmbBx_currentIndexChanged( int index );
199 void mDrawModeComboBox_currentIndexChanged( int index );
200 void mBlurRadiusSpnBx_valueChanged( double value );
201 void mBlurUnitWidget_changed();
202 void applyColorRamp();
203
204};
205
206#include "ui_widget_transform.h"
207
212class GUI_EXPORT QgsTransformWidget : public QgsPaintEffectWidget, private Ui::WidgetTransform
213{
214 Q_OBJECT
215
216 public:
217 QgsTransformWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
218
220
221 void setPaintEffect( QgsPaintEffect *effect ) override;
222
223 private:
224 QgsTransformEffect *mEffect = nullptr;
225
226 void initGui();
227 void blockSignals( bool block );
228
229 private slots:
230
231 void mDrawModeComboBox_currentIndexChanged( int index );
232 void mSpinTranslateX_valueChanged( double value );
233 void mSpinTranslateY_valueChanged( double value );
234 void mTranslateUnitWidget_changed();
235 void mReflectXCheckBox_stateChanged( int state );
236 void mReflectYCheckBox_stateChanged( int state );
237 void mSpinShearX_valueChanged( double value );
238 void mSpinShearY_valueChanged( double value );
239 void mSpinScaleX_valueChanged( double value );
240 void mSpinScaleY_valueChanged( double value );
241 void mRotationSpinBox_valueChanged( double value );
242
243};
244
245
246#include "ui_widget_coloreffects.h"
247
252class GUI_EXPORT QgsColorEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetColorEffect
253{
254 Q_OBJECT
255
256 public:
257 QgsColorEffectWidget( QWidget *parent = nullptr );
258
260
261 void setPaintEffect( QgsPaintEffect *effect ) override;
262
263 private:
264 QgsColorEffect *mEffect = nullptr;
265
266 void initGui();
267 void blockSignals( bool block );
268 void enableColorizeControls( bool enable );
269
270 private slots:
271
272 void opacityChanged( double value );
273 void mBlendCmbBx_currentIndexChanged( int index );
274 void mDrawModeComboBox_currentIndexChanged( int index );
275 void mBrightnessSpinBox_valueChanged( int value );
276 void mContrastSpinBox_valueChanged( int value );
277 void mSaturationSpinBox_valueChanged( int value );
278 void mColorizeStrengthSpinBox_valueChanged( int value );
279 void mColorizeCheck_stateChanged( int state );
280 void mColorizeColorButton_colorChanged( const QColor &color );
281 void mGrayscaleCombo_currentIndexChanged( int index );
282
283};
284
285
286
287#endif //QGSPAINTEFFECTWIDGET_H
A paint effect which blurs a source picture, using a number of different blur methods.
Definition: qgsblureffect.h:37
static QgsPaintEffectWidget * create()
static QgsPaintEffectWidget * create()
A paint effect which alters the colors (e.g., brightness, contrast) in a source picture.
A paint effect which draws the source picture with minor or no alterations.
static QgsPaintEffectWidget * create()
Base class for paint effect which draw a glow inside or outside a picture.
Definition: qgsgloweffect.h:38
static QgsPaintEffectWidget * create()
Base class for effect properties widgets.
QgsPaintEffectWidget(QWidget *parent=nullptr)
virtual void setPaintEffect(QgsPaintEffect *effect)=0
Sets the paint effect to modify with the widget.
void changed()
Emitted when properties of the effect are changed through the widget.
Base class for visual effects which can be applied to QPicture drawings.
static QgsPaintEffectWidget * create()
Base class for paint effects which offset, blurred shadows.
A paint effect which applies transformations (such as move, scale and rotate) to a picture.
static QgsPaintEffectWidget * create()
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_FACTORY
Definition: qgis_sip.h:76