QGIS API Documentation  3.2.0-Bonn (bc43194)
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 
23 class QgsPaintEffect;
24 class QgsShadowEffect;
26 class QgsBlurEffect;
27 class QgsGlowEffect;
28 class QgsTransformEffect;
29 class QgsColorEffect;
30 
31 
40 class GUI_EXPORT QgsPaintEffectWidget : public QWidget
41 {
42  Q_OBJECT
43 
44  public:
45  QgsPaintEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr ) : QWidget( parent ) {}
46 
51  virtual void setPaintEffect( QgsPaintEffect *effect ) = 0;
52 
53  signals:
54 
58  void changed();
59 
60 };
61 
62 //individual effect widgets
63 
64 #include "ui_widget_drawsource.h"
65 
70 class 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 
96 
97 #include "ui_widget_blur.h"
98 
103 class GUI_EXPORT QgsBlurWidget : public QgsPaintEffectWidget, private Ui::WidgetBlur
104 {
105  Q_OBJECT
106 
107  public:
108  QgsBlurWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
109 
111 
112  void setPaintEffect( QgsPaintEffect *effect ) override;
113 
114  private:
115  QgsBlurEffect *mEffect = nullptr;
116 
117  void initGui();
118  void blockSignals( bool block );
119 
120  private slots:
121 
122  void mBlurTypeCombo_currentIndexChanged( int index );
123  void mBlurStrengthSpnBx_valueChanged( int value );
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 
138 class 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( int value );
165 };
166 
167 
168 #include "ui_widget_glow.h"
169 
174 class GUI_EXPORT QgsGlowWidget : public QgsPaintEffectWidget, private Ui::WidgetGlow
175 {
176  Q_OBJECT
177 
178  public:
179  QgsGlowWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
180 
182 
183  void setPaintEffect( QgsPaintEffect *effect ) override;
184 
185  private:
186  QgsGlowEffect *mEffect = nullptr;
187 
188  void initGui();
189  void blockSignals( bool block );
190 
191  private slots:
192  void colorModeChanged();
193  void mSpreadSpnBx_valueChanged( double value );
194  void mSpreadUnitWidget_changed();
195  void opacityChanged( double value );
196  void mColorBtn_colorChanged( const QColor &color );
197  void mBlendCmbBx_currentIndexChanged( int index );
198  void mDrawModeComboBox_currentIndexChanged( int index );
199  void mBlurRadiusSpnBx_valueChanged( int value );
200  void applyColorRamp();
201 
202 };
203 
204 #include "ui_widget_transform.h"
205 
210 class GUI_EXPORT QgsTransformWidget : public QgsPaintEffectWidget, private Ui::WidgetTransform
211 {
212  Q_OBJECT
213 
214  public:
215  QgsTransformWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
216 
218 
219  void setPaintEffect( QgsPaintEffect *effect ) override;
220 
221  private:
222  QgsTransformEffect *mEffect = nullptr;
223 
224  void initGui();
225  void blockSignals( bool block );
226 
227  private slots:
228 
229  void mDrawModeComboBox_currentIndexChanged( int index );
230  void mSpinTranslateX_valueChanged( double value );
231  void mSpinTranslateY_valueChanged( double value );
232  void mTranslateUnitWidget_changed();
233  void mReflectXCheckBox_stateChanged( int state );
234  void mReflectYCheckBox_stateChanged( int state );
235  void mSpinShearX_valueChanged( double value );
236  void mSpinShearY_valueChanged( double value );
237  void mSpinScaleX_valueChanged( double value );
238  void mSpinScaleY_valueChanged( double value );
239  void mRotationSpinBox_valueChanged( double value );
240 
241 };
242 
243 
244 #include "ui_widget_coloreffects.h"
245 
250 class GUI_EXPORT QgsColorEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetColorEffect
251 {
252  Q_OBJECT
253 
254  public:
255  QgsColorEffectWidget( QWidget *parent = nullptr );
256 
258 
259  void setPaintEffect( QgsPaintEffect *effect ) override;
260 
261  private:
262  QgsColorEffect *mEffect = nullptr;
263 
264  void initGui();
265  void blockSignals( bool block );
266  void enableColorizeControls( bool enable );
267 
268  private slots:
269 
270  void opacityChanged( double value );
271  void mBlendCmbBx_currentIndexChanged( int index );
272  void mDrawModeComboBox_currentIndexChanged( int index );
273  void mBrightnessSpinBox_valueChanged( int value );
274  void mContrastSpinBox_valueChanged( int value );
275  void mSaturationSpinBox_valueChanged( int value );
276  void mColorizeStrengthSpinBox_valueChanged( int value );
277  void mColorizeCheck_stateChanged( int state );
278  void mColorizeColorButton_colorChanged( const QColor &color );
279  void mGrayscaleCombo_currentIndexChanged( int index );
280 
281 };
282 
283 
284 
285 #endif //QGSPAINTEFFECTWIDGET_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Base class for effect properties widgets.
Base class for visual effects which can be applied to QPicture drawings.
Base class for paint effect which draw a glow inside or outside a picture.
Definition: qgsgloweffect.h:38
static QgsPaintEffectWidget * create()
QgsPaintEffectWidget(QWidget *parent=nullptr)
#define SIP_FACTORY
Definition: qgis_sip.h:69
A paint effect which blurs a source picture, using a number of different blur methods.
Definition: qgsblureffect.h:34
static QgsPaintEffectWidget * create()
A paint effect which applies transformations (such as move, scale and rotate) to a picture...
virtual void setPaintEffect(QgsPaintEffect *effect)=0
Sets the paint effect to modify with the widget.
A paint effect which alters the colors (e.g., brightness, contrast) in a source picture.
Base class for paint effects which offset, blurred shadows.
static QgsPaintEffectWidget * create()
static QgsPaintEffectWidget * create()
A paint effect which draws the source picture with minor or no alterations.
static QgsPaintEffectWidget * create()
static QgsPaintEffectWidget * create()