QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
21 class QgsPaintEffect;
22 class QgsShadowEffect;
24 class QgsBlurEffect;
25 class QgsGlowEffect;
26 class QgsTransformEffect;
27 class QgsColorEffect;
28 
29 
37 class GUI_EXPORT QgsPaintEffectWidget : public QWidget
38 {
39  Q_OBJECT
40 
41  public:
42  QgsPaintEffectWidget( QWidget* parent = nullptr ) : QWidget( parent ) {}
43  virtual ~QgsPaintEffectWidget() {}
44 
49  virtual void setPaintEffect( QgsPaintEffect* effect ) = 0;
50 
51  signals:
52 
56  void changed();
57 
58 };
59 
60 //individual effect widgets
61 
62 #include "ui_widget_drawsource.h"
63 
67 class GUI_EXPORT QgsDrawSourceWidget : public QgsPaintEffectWidget, private Ui::WidgetDrawSource
68 {
69  Q_OBJECT
70 
71  public:
72  QgsDrawSourceWidget( QWidget* parent = nullptr );
73 
74  static QgsPaintEffectWidget* create() { return new QgsDrawSourceWidget(); }
75 
76  virtual void setPaintEffect( QgsPaintEffect* effect ) override;
77 
78  private:
79  QgsDrawSourceEffect* mEffect;
80 
81  void initGui();
82  void blockSignals( const bool block );
83 
84  private slots:
85 
86  void on_mTransparencySpnBx_valueChanged( double value );
87  void on_mDrawModeComboBox_currentIndexChanged( int index );
88  void on_mBlendCmbBx_currentIndexChanged( int index );
89  void on_mTransparencySlider_valueChanged( int value );
90 
91 };
92 
93 
94 
95 #include "ui_widget_blur.h"
96 
100 class GUI_EXPORT QgsBlurWidget : public QgsPaintEffectWidget, private Ui::WidgetBlur
101 {
102  Q_OBJECT
103 
104  public:
105  QgsBlurWidget( QWidget* parent = nullptr );
106 
107  static QgsPaintEffectWidget* create() { return new QgsBlurWidget(); }
108 
109  virtual void setPaintEffect( QgsPaintEffect* effect ) override;
110 
111  private:
112  QgsBlurEffect* mEffect;
113 
114  void initGui();
115  void blockSignals( const bool block );
116 
117  private slots:
118 
119  void on_mBlurTypeCombo_currentIndexChanged( int index );
120  void on_mBlurStrengthSpnBx_valueChanged( int value );
121  void on_mTransparencySpnBx_valueChanged( double value );
122  void on_mDrawModeComboBox_currentIndexChanged( int index );
123  void on_mBlendCmbBx_currentIndexChanged( int index );
124  void on_mTransparencySlider_valueChanged( int value );
125 
126 };
127 
128 
129 
130 #include "ui_widget_shadoweffect.h"
131 
135 class GUI_EXPORT QgsShadowEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetShadowEffect
136 {
137  Q_OBJECT
138 
139  public:
140  QgsShadowEffectWidget( QWidget* parent = nullptr );
141 
143 
144  virtual void setPaintEffect( QgsPaintEffect* effect ) override;
145 
146  private:
147  QgsShadowEffect* mEffect;
148 
149  void initGui();
150  void blockSignals( const bool block );
151 
152  private slots:
153  void on_mShadowOffsetAngleSpnBx_valueChanged( int value );
154  void on_mShadowOffsetAngleDial_valueChanged( int value );
155  void on_mShadowOffsetSpnBx_valueChanged( double value );
156  void on_mOffsetUnitWidget_changed();
157  void on_mShadowTranspSpnBx_valueChanged( double value );
158  void on_mShadowColorBtn_colorChanged( const QColor& color );
159  void on_mDrawModeComboBox_currentIndexChanged( int index );
160  void on_mShadowBlendCmbBx_currentIndexChanged( int index );
161  void on_mShadowRadiuSpnBx_valueChanged( int value );
162  void on_mShadowTranspSlider_valueChanged( int value );
163 };
164 
165 
166 #include "ui_widget_glow.h"
167 
171 class GUI_EXPORT QgsGlowWidget : public QgsPaintEffectWidget, private Ui::WidgetGlow
172 {
173  Q_OBJECT
174 
175  public:
176  QgsGlowWidget( QWidget* parent = nullptr );
177 
178  static QgsPaintEffectWidget* create() { return new QgsGlowWidget(); }
179 
180  virtual void setPaintEffect( QgsPaintEffect* effect ) override;
181 
182  private:
183  QgsGlowEffect* mEffect;
184 
185  void initGui();
186  void blockSignals( const bool block );
187 
188  private slots:
189  void colorModeChanged();
190  void on_mSpreadSpnBx_valueChanged( double value );
191  void on_mSpreadUnitWidget_changed();
192  void on_mTranspSpnBx_valueChanged( double value );
193  void on_mColorBtn_colorChanged( const QColor& color );
194  void on_mBlendCmbBx_currentIndexChanged( int index );
195  void on_mDrawModeComboBox_currentIndexChanged( int index );
196  void on_mBlurRadiusSpnBx_valueChanged( int value );
197  void on_mTranspSlider_valueChanged( int value );
198  void applyColorRamp();
199 
200 };
201 
202 #include "ui_widget_transform.h"
203 
207 class GUI_EXPORT QgsTransformWidget : public QgsPaintEffectWidget, private Ui::WidgetTransform
208 {
209  Q_OBJECT
210 
211  public:
212  QgsTransformWidget( QWidget* parent = nullptr );
213 
214  static QgsPaintEffectWidget* create() { return new QgsTransformWidget(); }
215 
216  virtual void setPaintEffect( QgsPaintEffect* effect ) override;
217 
218  private:
219  QgsTransformEffect* mEffect;
220 
221  void initGui();
222  void blockSignals( const bool block );
223 
224  private slots:
225 
226  void on_mDrawModeComboBox_currentIndexChanged( int index );
227  void on_mSpinTranslateX_valueChanged( double value );
228  void on_mSpinTranslateY_valueChanged( double value );
229  void on_mTranslateUnitWidget_changed();
230  void on_mReflectXCheckBox_stateChanged( int state );
231  void on_mReflectYCheckBox_stateChanged( int state );
232  void on_mSpinShearX_valueChanged( double value );
233  void on_mSpinShearY_valueChanged( double value );
234  void on_mSpinScaleX_valueChanged( double value );
235  void on_mSpinScaleY_valueChanged( double value );
236  void on_mRotationSpinBox_valueChanged( double value );
237 
238 };
239 
240 
241 #include "ui_widget_coloreffects.h"
242 
246 class GUI_EXPORT QgsColorEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetColorEffect
247 {
248  Q_OBJECT
249 
250  public:
251  QgsColorEffectWidget( QWidget* parent = nullptr );
252 
254 
255  virtual void setPaintEffect( QgsPaintEffect* effect ) override;
256 
257  private:
258  QgsColorEffect* mEffect;
259 
260  void initGui();
261  void blockSignals( const bool block );
262  void enableColorizeControls( const bool enable );
263 
264  private slots:
265 
266  void on_mTranspSpnBx_valueChanged( double value );
267  void on_mBlendCmbBx_currentIndexChanged( int index );
268  void on_mDrawModeComboBox_currentIndexChanged( int index );
269  void on_mTranspSlider_valueChanged( int value );
270  void on_mBrightnessSpinBox_valueChanged( int value );
271  void on_mContrastSpinBox_valueChanged( int value );
272  void on_mSaturationSpinBox_valueChanged( int value );
273  void on_mColorizeStrengthSpinBox_valueChanged( int value );
274  void on_mColorizeCheck_stateChanged( int state );
275  void on_mColorizeColorButton_colorChanged( const QColor& color );
276  void on_mGrayscaleCombo_currentIndexChanged( int index );
277 
278 };
279 
280 
281 
282 #endif //QGSPAINTEFFECTWIDGET_H
static unsigned index
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:34
static QgsPaintEffectWidget * create()
QgsPaintEffectWidget(QWidget *parent=nullptr)
A paint effect which blurs a source picture, using a number of different blur methods.
Definition: qgsblureffect.h:32
static QgsPaintEffectWidget * create()
bool blockSignals(bool block)
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 (eg 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()