QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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 "qgis_gui.h"
20#include "qgis_sip.h"
21
22#include <QWidget>
23
24class QgsPaintEffect;
25class QgsShadowEffect;
27class QgsBlurEffect;
28class QgsGlowEffect;
30class QgsColorEffect;
31
32
38class GUI_EXPORT QgsPaintEffectWidget : public QWidget
39{
40 Q_OBJECT
41
42 public:
43 QgsPaintEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr )
44 : QWidget( parent )
45 {}
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
70class GUI_EXPORT QgsDrawSourceWidget : public QgsPaintEffectWidget, private Ui::WidgetDrawSource
71{
72 Q_OBJECT
73
74 public:
75 QgsDrawSourceWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
76
78
79 void setPaintEffect( QgsPaintEffect *effect ) override;
80
81 private:
82 QgsDrawSourceEffect *mEffect = nullptr;
83
84 void initGui();
85 void blockSignals( bool block );
86
87 private slots:
88
89 void opacityChanged( double value );
90 void mDrawModeComboBox_currentIndexChanged( int index );
91 void mBlendCmbBx_currentIndexChanged( int index );
92};
93
94
95#include "ui_widget_blur.h"
96
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#include "ui_widget_shadoweffect.h"
131
137class GUI_EXPORT QgsShadowEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetShadowEffect
138{
139 Q_OBJECT
140
141 public:
142 QgsShadowEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
143
145
146 void setPaintEffect( QgsPaintEffect *effect ) override;
147
148 private:
149 QgsShadowEffect *mEffect = nullptr;
150
151 void initGui();
152 void blockSignals( bool block );
153
154 private slots:
155 void mShadowOffsetAngleSpnBx_valueChanged( int value );
156 void mShadowOffsetAngleDial_valueChanged( int value );
157 void mShadowOffsetSpnBx_valueChanged( double value );
158 void mOffsetUnitWidget_changed();
159 void opacityChanged( double value );
160 void mShadowColorBtn_colorChanged( const QColor &color );
161 void mDrawModeComboBox_currentIndexChanged( int index );
162 void mShadowBlendCmbBx_currentIndexChanged( int index );
163 void mShadowRadiuSpnBx_valueChanged( double value );
164 void mBlurUnitWidget_changed();
165};
166
167
168#include "ui_widget_glow.h"
169
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#include "ui_widget_transform.h"
206
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#include "ui_widget_coloreffects.h"
246
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#endif //QGSPAINTEFFECTWIDGET_H
A paint effect which blurs a source picture, using a number of different blur methods.
QgsBlurWidget(QWidget *parent=nullptr)
static QgsPaintEffectWidget * create()
static QgsPaintEffectWidget * create()
QgsColorEffectWidget(QWidget *parent=nullptr)
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()
QgsDrawSourceWidget(QWidget *parent=nullptr)
Base class for paint effects which draw a glow inside or outside a picture.
static QgsPaintEffectWidget * create()
QgsGlowWidget(QWidget *parent=nullptr)
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()
QgsShadowEffectWidget(QWidget *parent=nullptr)
Base class for paint effects which render offset, blurred shadows.
A paint effect which applies transformations (such as move, scale and rotate) to a picture.
static QgsPaintEffectWidget * create()
QgsTransformWidget(QWidget *parent=nullptr)
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_FACTORY
Definition qgis_sip.h:83