QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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 )
45 : QWidget( parent ) {}
46
51 virtual void setPaintEffect( QgsPaintEffect *effect ) = 0;
52
53 signals:
54
58 void changed();
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#include "ui_widget_blur.h"
95
100class GUI_EXPORT QgsBlurWidget : public QgsPaintEffectWidget, private Ui::WidgetBlur
101{
102 Q_OBJECT
103
104 public:
105 QgsBlurWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
106
108
109 void setPaintEffect( QgsPaintEffect *effect ) override;
110
111 private:
112 QgsBlurEffect *mEffect = nullptr;
113
114 void initGui();
115 void blockSignals( bool block );
116
117 private slots:
118
119 void mBlurTypeCombo_currentIndexChanged( int index );
120 void mBlurStrengthSpnBx_valueChanged( double value );
121 void mBlurUnitWidget_changed();
122 void opacityChanged( double value );
123 void mDrawModeComboBox_currentIndexChanged( int index );
124 void mBlendCmbBx_currentIndexChanged( int index );
125};
126
127
128#include "ui_widget_shadoweffect.h"
129
134class GUI_EXPORT QgsShadowEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetShadowEffect
135{
136 Q_OBJECT
137
138 public:
139 QgsShadowEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
140
142
143 void setPaintEffect( QgsPaintEffect *effect ) override;
144
145 private:
146 QgsShadowEffect *mEffect = nullptr;
147
148 void initGui();
149 void blockSignals( bool block );
150
151 private slots:
152 void mShadowOffsetAngleSpnBx_valueChanged( int value );
153 void mShadowOffsetAngleDial_valueChanged( int value );
154 void mShadowOffsetSpnBx_valueChanged( double value );
155 void mOffsetUnitWidget_changed();
156 void opacityChanged( double value );
157 void mShadowColorBtn_colorChanged( const QColor &color );
158 void mDrawModeComboBox_currentIndexChanged( int index );
159 void mShadowBlendCmbBx_currentIndexChanged( int index );
160 void mShadowRadiuSpnBx_valueChanged( double value );
161 void mBlurUnitWidget_changed();
162};
163
164
165#include "ui_widget_glow.h"
166
171class GUI_EXPORT QgsGlowWidget : public QgsPaintEffectWidget, private Ui::WidgetGlow
172{
173 Q_OBJECT
174
175 public:
176 QgsGlowWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
177
179
180 void setPaintEffect( QgsPaintEffect *effect ) override;
181
182 private:
183 QgsGlowEffect *mEffect = nullptr;
184
185 void initGui();
186 void blockSignals( bool block );
187
188 private slots:
189 void colorModeChanged();
190 void mSpreadSpnBx_valueChanged( double value );
191 void mSpreadUnitWidget_changed();
192 void opacityChanged( double value );
193 void mColorBtn_colorChanged( const QColor &color );
194 void mBlendCmbBx_currentIndexChanged( int index );
195 void mDrawModeComboBox_currentIndexChanged( int index );
196 void mBlurRadiusSpnBx_valueChanged( double value );
197 void mBlurUnitWidget_changed();
198 void applyColorRamp();
199};
200
201#include "ui_widget_transform.h"
202
207class GUI_EXPORT QgsTransformWidget : public QgsPaintEffectWidget, private Ui::WidgetTransform
208{
209 Q_OBJECT
210
211 public:
212 QgsTransformWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
213
215
216 void setPaintEffect( QgsPaintEffect *effect ) override;
217
218 private:
219 QgsTransformEffect *mEffect = nullptr;
220
221 void initGui();
222 void blockSignals( bool block );
223
224 private slots:
225
226 void mDrawModeComboBox_currentIndexChanged( int index );
227 void mSpinTranslateX_valueChanged( double value );
228 void mSpinTranslateY_valueChanged( double value );
229 void mTranslateUnitWidget_changed();
230 void mReflectXCheckBox_stateChanged( int state );
231 void mReflectYCheckBox_stateChanged( int state );
232 void mSpinShearX_valueChanged( double value );
233 void mSpinShearY_valueChanged( double value );
234 void mSpinScaleX_valueChanged( double value );
235 void mSpinScaleY_valueChanged( double value );
236 void mRotationSpinBox_valueChanged( double value );
237};
238
239
240#include "ui_widget_coloreffects.h"
241
246class GUI_EXPORT QgsColorEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetColorEffect
247{
248 Q_OBJECT
249
250 public:
251 QgsColorEffectWidget( QWidget *parent = nullptr );
252
254
255 void setPaintEffect( QgsPaintEffect *effect ) override;
256
257 private:
258 QgsColorEffect *mEffect = nullptr;
259
260 void initGui();
261 void blockSignals( bool block );
262 void enableColorizeControls( bool enable );
263
264 private slots:
265
266 void opacityChanged( double value );
267 void mBlendCmbBx_currentIndexChanged( int index );
268 void mDrawModeComboBox_currentIndexChanged( int index );
269 void mBrightnessSpinBox_valueChanged( int value );
270 void mContrastSpinBox_valueChanged( int value );
271 void mSaturationSpinBox_valueChanged( int value );
272 void mColorizeStrengthSpinBox_valueChanged( int value );
273 void mColorizeCheck_stateChanged( int state );
274 void mColorizeColorButton_colorChanged( const QColor &color );
275 void mGrayscaleCombo_currentIndexChanged( int index );
276};
277
278
279#endif //QGSPAINTEFFECTWIDGET_H
A paint effect which blurs a source picture, using a number of different blur methods.
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.
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