QGIS API Documentation 3.99.0-Master (26c88405ac0)
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 "ui_qgseffectstackpropertieswidgetbase.h"
20
21#include "qgis.h"
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgsdialog.h"
25#include "qgspanelwidget.h"
26
27#include <QPicture>
28#include <QStandardItemModel>
29#include <QWidget>
30
31class EffectItem;
32class QgsPaintEffect;
33class QCheckBox;
34class QToolButton;
35class QgsPanelWidget;
36class QgsEffectStack;
37class QgsPaintEffect;
38
49
50class GUI_EXPORT QgsEffectStackPropertiesWidget : public QgsPanelWidget, private Ui::QgsEffectStackPropertiesWidgetBase
51{
52 Q_OBJECT
53
54 public:
55
62
64
70
75 void setPreviewPicture( const QPicture &picture );
76
77 public slots:
78
82 void moveEffectDown();
83
87 void moveEffectUp();
88
92 void addEffect();
93
97 void removeEffect();
98
102 void effectChanged();
103
107 void updatePreview();
108
113 void changeEffect( QgsPaintEffect *newEffect );
114
115 protected:
117 QStandardItemModel *mModel = nullptr;
118 QWidget *mPresentWidget = nullptr;
120
124 void loadStack();
125
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
165
167{
168 Q_OBJECT
169
170 public:
171
178 QgsEffectStackPropertiesDialog( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
179
185
190 void setPreviewPicture( const QPicture &picture );
191
192 protected:
194
195 private slots:
196
197 void showHelp();
198};
199
200
211
213{
214 Q_OBJECT
215
216 public:
217
225 QgsEffectStackCompactWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsPaintEffect *effect = nullptr );
227
235 void setPaintEffect( QgsPaintEffect *effect );
236
243
248 void setPreviewPicture( const QPicture &picture );
249
250 signals:
251
255 void changed();
256
257 private slots:
258
259 void showDialog();
260
261 void enableToggled( bool checked );
262
263 void updateAcceptWidget( QgsPanelWidget *panel );
264 void updateEffectLive();
265
266 private:
267 QgsEffectStack *mStack = nullptr;
268 QCheckBox *mEnabledCheckBox = nullptr;
269 QToolButton *mButton = nullptr;
270 QPicture mPreviewPicture;
271};
272
273#endif //QGSEFFECTSTACKPROPERTIESWIDGET_H
QgsDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Close, Qt::Orientation orientation=Qt::Horizontal)
Constructor for QgsDialog.
Definition qgsdialog.cpp:22
~QgsEffectStackCompactWidget() override
QgsEffectStackCompactWidget(QWidget *parent=nullptr, QgsPaintEffect *effect=nullptr)
QgsEffectStackCompactWidget constructor.
void setPreviewPicture(const QPicture &picture)
Sets the picture to use for effect previews for the dialog.
QgsPaintEffect * paintEffect() const
Returns paint effect attached to the widget.
void setPaintEffect(QgsPaintEffect *effect)
Sets paint effect attached to the widget,.
void changed()
Emitted when the paint effect properties change.
void setPreviewPicture(const QPicture &picture)
Sets the picture to use for effect previews for the dialog.
QgsEffectStackPropertiesWidget * mPropertiesWidget
QgsEffectStackPropertiesDialog(QgsEffectStack *stack, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
QgsEffectStackPropertiesDialog constructor.
QgsEffectStack * stack()
Returns effect stack attached to the dialog.
A widget for modifying the properties of a QgsEffectStack, including adding and reordering effects wi...
void moveEffectByOffset(int offset)
Moves the currently selected effect within the stack by a specified offset.
void loadStack()
Refreshes the widget to reflect the current state of the stack.
QgsEffectStackPropertiesWidget(QgsEffectStack *stack, QWidget *parent=nullptr)
QgsEffectStackPropertiesWidget constructor.
void updateUi()
Enables or disables widgets depending on the selected effect within the stack.
QgsEffectStack * stack()
Returns effect stack attached to the widget.
~QgsEffectStackPropertiesWidget() override
void setWidget(QWidget *widget)
Sets the effect properties widget.
EffectItem * currentEffectItem()
Returns the currently selected effect within the stack.
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.
QgsPanelWidget(QWidget *parent=nullptr)
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:134