QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
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 <QPicture>
25#include "qgspanelwidget.h"
26
27#include "ui_qgseffectstackpropertieswidgetbase.h"
28#include "qgis_gui.h"
29
30class EffectItem;
31class QgsPaintEffect;
32class QCheckBox;
33class QToolButton;
34class QgsPanelWidget;
35class QgsEffectStack;
36class QgsPaintEffect;
37
49class 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;
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
168{
169 Q_OBJECT
170
171 public:
172
179 QgsEffectStackPropertiesDialog( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
180
185 QgsEffectStack *stack();
186
191 void setPreviewPicture( const QPicture &picture );
192
193 protected:
194
195 QgsEffectStackPropertiesWidget *mPropertiesWidget = nullptr;
196
197 private slots:
198
199 void showHelp();
200
201};
202
203
216{
217 Q_OBJECT
218
219 public:
220
228 QgsEffectStackCompactWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsPaintEffect *effect = nullptr );
230
238 void setPaintEffect( QgsPaintEffect *effect );
239
245 QgsPaintEffect *paintEffect() const;
246
251 void setPreviewPicture( const QPicture &picture );
252
253 signals:
254
258 void changed();
259
260 private slots:
261
262 void showDialog();
263
264 void enableToggled( bool checked );
265
266 void updateAcceptWidget( QgsPanelWidget *panel );
267 void updateEffectLive();
268
269 private:
270 QgsEffectStack *mStack = nullptr;
271 QCheckBox *mEnabledCheckBox = nullptr;
272 QToolButton *mButton = nullptr;
273 QPicture mPreviewPicture;
274
275};
276
277#endif //QGSEFFECTSTACKPROPERTIESWIDGET_H
A generic dialog with layout and button box.
Definition qgsdialog.h:34
A small widget consisting of a checkbox for enabling/disabling an effect stack and a button for openi...
~QgsEffectStackCompactWidget() override
void changed()
Emitted when the paint effect properties change.
A dialog for modifying the properties of a QgsEffectStack, including adding and reordering effects wi...
A widget for modifying the properties of a QgsEffectStack, including adding and reordering effects wi...
QgsEffectStack * stack()
Returns effect stack attached to the widget.
~QgsEffectStackPropertiesWidget() override
A paint effect which consists of a stack of other chained paint effects.
Base class for visual effects which can be applied to QPicture drawings.
Base class for any widget that can be shown as a inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:126