QGIS API Documentation 3.43.0-Master (b60ef06885e)
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:
59 QgsEffectStackPropertiesWidget( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr );
60
62
67 QgsEffectStack *stack() { return mStack; }
68
73 void setPreviewPicture( const QPicture &picture );
74
75 public slots:
76
80 void moveEffectDown();
81
85 void moveEffectUp();
86
90 void addEffect();
91
95 void removeEffect();
96
100 void effectChanged();
101
105 void updatePreview();
106
111 void changeEffect( QgsPaintEffect *newEffect );
112
113 protected:
114 QgsEffectStack *mStack = nullptr;
115 QStandardItemModel *mModel = nullptr;
116 QWidget *mPresentWidget = nullptr;
118
122 void loadStack();
123
128 void loadStack( QgsEffectStack *stack );
129
133 void updateUi();
134
139 EffectItem *currentEffectItem() SIP_SKIP;
140
144 void moveEffectByOffset( int offset );
145
149 void setWidget( QWidget *widget );
150};
151
152
165{
166 Q_OBJECT
167
168 public:
175 QgsEffectStackPropertiesDialog( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
176
181 QgsEffectStack *stack();
182
187 void setPreviewPicture( const QPicture &picture );
188
189 protected:
190 QgsEffectStackPropertiesWidget *mPropertiesWidget = nullptr;
191
192 private slots:
193
194 void showHelp();
195};
196
197
210{
211 Q_OBJECT
212
213 public:
221 QgsEffectStackCompactWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsPaintEffect *effect = nullptr );
223
231 void setPaintEffect( QgsPaintEffect *effect );
232
238 QgsPaintEffect *paintEffect() const;
239
244 void setPreviewPicture( const QPicture &picture );
245
246 signals:
247
251 void changed();
252
253 private slots:
254
255 void showDialog();
256
257 void enableToggled( bool checked );
258
259 void updateAcceptWidget( QgsPanelWidget *panel );
260 void updateEffectLive();
261
262 private:
263 QgsEffectStack *mStack = nullptr;
264 QCheckBox *mEnabledCheckBox = nullptr;
265 QToolButton *mButton = nullptr;
266 QPicture mPreviewPicture;
267};
268
269#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 an inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:126