QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
50 virtual void setPaintEffect( QgsPaintEffect *effect ) = 0;
51
52 signals:
53
57 void changed();
58};
59
60//individual effect widgets
61
62#include "ui_widget_drawsource.h"
63
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
101class GUI_EXPORT QgsBlurWidget : public QgsPaintEffectWidget, private Ui::WidgetBlur
102{
103 Q_OBJECT
104
105 public:
106 QgsBlurWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
107
109
110 void setPaintEffect( QgsPaintEffect *effect ) override;
111
112 private:
113 QgsBlurEffect *mEffect = nullptr;
114
115 void initGui();
116 void blockSignals( bool block );
117
118 private slots:
119
120 void mBlurTypeCombo_currentIndexChanged( int index );
121 void mBlurStrengthSpnBx_valueChanged( double value );
122 void mBlurUnitWidget_changed();
123 void opacityChanged( double value );
124 void mDrawModeComboBox_currentIndexChanged( int index );
125 void mBlendCmbBx_currentIndexChanged( int index );
126};
127
128
129#include "ui_widget_shadoweffect.h"
130
136class GUI_EXPORT QgsShadowEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetShadowEffect
137{
138 Q_OBJECT
139
140 public:
141 QgsShadowEffectWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
142
144
145 void setPaintEffect( QgsPaintEffect *effect ) override;
146
147 private:
148 QgsShadowEffect *mEffect = nullptr;
149
150 void initGui();
151 void blockSignals( bool block );
152
153 private slots:
154 void mShadowOffsetAngleSpnBx_valueChanged( int value );
155 void mShadowOffsetAngleDial_valueChanged( int value );
156 void mShadowOffsetSpnBx_valueChanged( double value );
157 void mOffsetUnitWidget_changed();
158 void opacityChanged( double value );
159 void mShadowColorBtn_colorChanged( const QColor &color );
160 void mDrawModeComboBox_currentIndexChanged( int index );
161 void mShadowBlendCmbBx_currentIndexChanged( int index );
162 void mShadowRadiuSpnBx_valueChanged( double value );
163 void mBlurUnitWidget_changed();
164};
165
166
167#include "ui_widget_glow.h"
168
174class 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( double value );
200 void mBlurUnitWidget_changed();
201 void applyColorRamp();
202};
203
204#include "ui_widget_transform.h"
205
211class GUI_EXPORT QgsTransformWidget : public QgsPaintEffectWidget, private Ui::WidgetTransform
212{
213 Q_OBJECT
214
215 public:
216 QgsTransformWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
217
219
220 void setPaintEffect( QgsPaintEffect *effect ) override;
221
222 private:
223 QgsTransformEffect *mEffect = nullptr;
224
225 void initGui();
226 void blockSignals( bool block );
227
228 private slots:
229
230 void mDrawModeComboBox_currentIndexChanged( int index );
231 void mSpinTranslateX_valueChanged( double value );
232 void mSpinTranslateY_valueChanged( double value );
233 void mTranslateUnitWidget_changed();
234 void mReflectXCheckBox_stateChanged( int state );
235 void mReflectYCheckBox_stateChanged( int state );
236 void mSpinShearX_valueChanged( double value );
237 void mSpinShearY_valueChanged( double value );
238 void mSpinScaleX_valueChanged( double value );
239 void mSpinScaleY_valueChanged( double value );
240 void mRotationSpinBox_valueChanged( double value );
241};
242
243
244#include "ui_widget_coloreffects.h"
245
251class GUI_EXPORT QgsColorEffectWidget : public QgsPaintEffectWidget, private Ui::WidgetColorEffect
252{
253 Q_OBJECT
254
255 public:
256 QgsColorEffectWidget( QWidget *parent = nullptr );
257
259
260 void setPaintEffect( QgsPaintEffect *effect ) override;
261
262 private:
263 QgsColorEffect *mEffect = nullptr;
264
265 void initGui();
266 void blockSignals( bool block );
267 void enableColorizeControls( bool enable );
268
269 private slots:
270
271 void opacityChanged( double value );
272 void mBlendCmbBx_currentIndexChanged( int index );
273 void mDrawModeComboBox_currentIndexChanged( int index );
274 void mBrightnessSpinBox_valueChanged( int value );
275 void mContrastSpinBox_valueChanged( int value );
276 void mSaturationSpinBox_valueChanged( int value );
277 void mColorizeStrengthSpinBox_valueChanged( int value );
278 void mColorizeCheck_stateChanged( int state );
279 void mColorizeColorButton_colorChanged( const QColor &color );
280 void mGrayscaleCombo_currentIndexChanged( int index );
281};
282
283
284#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:53
#define SIP_FACTORY
Definition qgis_sip.h:84