QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgseffectstackpropertieswidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgseffectstackpropertieswidget.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 QGSEFFECTSTACKPROPERTIESWIDGET_H
17 #define QGSEFFECTSTACKPROPERTIESWIDGET_H
18 
19 #include "qgsdialog.h"
20 #include "effects/qgseffectstack.h"
21 #include <QWidget>
22 #include <QStandardItemModel>
23 #include <qgspanelwidget.h>
24 
25 #include "ui_qgseffectstackpropertieswidgetbase.h"
26 
27 class EffectItem;
28 class QgsPaintEffect;
29 class QCheckBox;
30 class QToolButton;
31 class QgsPanelWidget;
32 
44 class GUI_EXPORT QgsEffectStackPropertiesWidget : public QgsPanelWidget, private Ui::QgsEffectStackPropertiesWidgetBase
45 {
46  Q_OBJECT
47 
48  public:
49 
54  QgsEffectStackPropertiesWidget( QgsEffectStack* stack, QWidget* parent = nullptr );
55 
57 
61  QgsEffectStack* stack() { return mStack; }
62 
66  void setPreviewPicture( const QPicture& picture );
67 
68  public slots:
69 
72  void moveEffectDown();
73 
76  void moveEffectUp();
77 
80  void addEffect();
81 
84  void removeEffect();
85 
88  void effectChanged();
89 
92  void updatePreview();
93 
97  void changeEffect( QgsPaintEffect* newEffect );
98 
99  protected:
100 
105 
108  void loadStack();
109 
113  void loadStack( QgsEffectStack* stack );
114 
117  void updateUi();
118 
122  EffectItem* currentEffectItem();
123 
126  void moveEffectByOffset( int offset );
127 
130  void setWidget( QWidget* widget );
131 
132 };
133 
134 
147 {
148  Q_OBJECT
149 
150  public:
151 
157  QgsEffectStackPropertiesDialog( QgsEffectStack* stack, QWidget* parent = nullptr, const Qt::WindowFlags& f = nullptr );
159 
163  QgsEffectStack* stack();
164 
168  void setPreviewPicture( const QPicture& picture );
169 
170  protected:
171 
173 
174 };
175 
176 
189 {
190  Q_OBJECT
191 
192  public:
193 
200  QgsEffectStackCompactWidget( QWidget* parent = nullptr, QgsPaintEffect* effect = nullptr );
202 
209  void setPaintEffect( QgsPaintEffect* effect );
210 
215  QgsPaintEffect* paintEffect() const { return mStack; }
216 
220  void setPreviewPicture( const QPicture &picture );
221 
222  signals:
223 
226  void changed();
227 
228  private slots:
229 
230  void showDialog();
231 
232  void enableToggled( bool checked );
233 
234  void updateAcceptWidget( QgsPanelWidget* panel );
235  void updateEffectLive();
236 
237  private:
238  QgsEffectStack* mStack;
239  QCheckBox* mEnabledCheckBox;
240  QToolButton* mButton;
241  QPicture* mPreviewPicture;
242 
243 };
244 
245 #endif //QGSEFFECTSTACKPROPERTIESWIDGET_H
QgsPaintEffect * paintEffect() const
Returns paint effect attached to the widget.
A dialog for modifying the properties of a QgsEffectStack, including adding and reordering effects wi...
Base class for visual effects which can be applied to QPicture drawings.
A generic dialog with layout and button box.
Definition: qgsdialog.h:30
Base class for any widget that can be shown as a inline panel.
A widget for modifying the properties of a QgsEffectStack, including adding and reordering effects wi...
QgsEffectStack * stack()
Returns effect stack attached to the widget.
A small widget consisting of a check box for enabling/disabling an effect stack and a button for open...
A paint effect which consists of a stack of other chained paint effects.
QgsEffectStackPropertiesWidget * mPropertiesWidget
typedef WindowFlags