QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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:
61
63
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:
116 QStandardItemModel *mModel = nullptr;
117 QWidget *mPresentWidget = nullptr;
119
123 void loadStack();
124
130
134 void updateUi();
135
140 EffectItem *currentEffectItem() SIP_SKIP;
141
145 void moveEffectByOffset( int offset );
146
150 void setWidget( QWidget *widget );
151};
152
153
164
166{
167 Q_OBJECT
168
169 public:
176 QgsEffectStackPropertiesDialog( QgsEffectStack *stack, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
177
183
188 void setPreviewPicture( const QPicture &picture );
189
190 protected:
192
193 private slots:
194
195 void showHelp();
196};
197
198
209
211{
212 Q_OBJECT
213
214 public:
222 QgsEffectStackCompactWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsPaintEffect *effect = nullptr );
224
232 void setPaintEffect( QgsPaintEffect *effect );
233
240
245 void setPreviewPicture( const QPicture &picture );
246
247 signals:
248
252 void changed();
253
254 private slots:
255
256 void showDialog();
257
258 void enableToggled( bool checked );
259
260 void updateAcceptWidget( QgsPanelWidget *panel );
261 void updateEffectLive();
262
263 private:
264 QgsEffectStack *mStack = nullptr;
265 QCheckBox *mEnabledCheckBox = nullptr;
266 QToolButton *mButton = nullptr;
267 QPicture mPreviewPicture;
268};
269
270#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