QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 "qgis_sip.h"
21 #include "qgis.h"
22 #include <QWidget>
23 #include <QStandardItemModel>
24 #include "qgspanelwidget.h"
25 
26 #include "ui_qgseffectstackpropertieswidgetbase.h"
27 #include "qgis_gui.h"
28 
29 class EffectItem;
30 class QgsPaintEffect;
31 class QCheckBox;
32 class QToolButton;
33 class QgsPanelWidget;
34 class QgsEffectStack;
35 class QgsPaintEffect;
36 
49 class GUI_EXPORT QgsEffectStackPropertiesWidget : public QgsPanelWidget, private Ui::QgsEffectStackPropertiesWidgetBase
50 {
51  Q_OBJECT
52 
53  public:
54 
60  QgsEffectStackPropertiesWidget( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr );
61 
63 
68  QgsEffectStack *stack() { return mStack; }
69 
74  void setPreviewPicture( const QPicture &picture );
75 
76  public slots:
77 
81  void moveEffectDown();
82 
86  void moveEffectUp();
87 
91  void addEffect();
92 
96  void removeEffect();
97 
101  void effectChanged();
102 
106  void updatePreview();
107 
112  void changeEffect( QgsPaintEffect *newEffect );
113 
114  protected:
115 
116  QgsEffectStack *mStack = nullptr;
117  QStandardItemModel *mModel = nullptr;
118  QWidget *mPresentWidget = nullptr;
119  QPicture *mPreviewPicture = nullptr;
120 
124  void loadStack();
125 
130  void loadStack( QgsEffectStack *stack );
131 
135  void updateUi();
136 
141  EffectItem *currentEffectItem() SIP_SKIP;
142 
146  void moveEffectByOffset( int offset );
147 
151  void setWidget( QWidget *widget );
152 
153 };
154 
155 
169 {
170  Q_OBJECT
171 
172  public:
173 
180  QgsEffectStackPropertiesDialog( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags f = nullptr );
181 
186  QgsEffectStack *stack();
187 
192  void setPreviewPicture( const QPicture &picture );
193 
194  protected:
195 
196  QgsEffectStackPropertiesWidget *mPropertiesWidget = nullptr;
197 
198  private slots:
199 
200  void showHelp();
201 
202 };
203 
204 
218 {
219  Q_OBJECT
220 
221  public:
222 
230  QgsEffectStackCompactWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsPaintEffect *effect = nullptr );
231  ~QgsEffectStackCompactWidget() override;
232 
240  void setPaintEffect( QgsPaintEffect *effect );
241 
247  QgsPaintEffect *paintEffect() const;
248 
253  void setPreviewPicture( const QPicture &picture );
254 
255  signals:
256 
260  void changed();
261 
262  private slots:
263 
264  void showDialog();
265 
266  void enableToggled( bool checked );
267 
268  void updateAcceptWidget( QgsPanelWidget *panel );
269  void updateEffectLive();
270 
271  private:
272  QgsEffectStack *mStack = nullptr;
273  QCheckBox *mEnabledCheckBox = nullptr;
274  QToolButton *mButton = nullptr;
275  QPicture *mPreviewPicture = nullptr;
276 
277 };
278 
279 #endif //QGSEFFECTSTACKPROPERTIESWIDGET_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
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:33
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...
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsEffectStack * stack()
Returns effect stack attached to the widget.
A small widget consisting of a checkbox for enabling/disabling an effect stack and a button for openi...
A paint effect which consists of a stack of other chained paint effects.