Krita Source Code Documentation
Loading...
Searching...
No Matches
KisWdgBlur Class Reference

#include <kis_wdg_blur.h>

+ Inheritance diagram for KisWdgBlur:

Public Member Functions

KisPropertiesConfigurationSP configuration () const override
 
 KisWdgBlur (QWidget *parent)
 
void setConfiguration (const KisPropertiesConfigurationSP) override
 
const Ui_WdgBlur * widget () const
 
 ~KisWdgBlur () override
 
- Public Member Functions inherited from KisConfigWidget
virtual KoCanvasResourcesInterfaceSP canvasResourcesInterface () const
 
virtual void setCanvasResourcesInterface (KoCanvasResourcesInterfaceSP canvasResourcesInterface)
 
virtual void setView (KisViewManager *view)
 
 ~KisConfigWidget () override
 

Private Slots

void linkSpacingToggled (bool)
 
void sldHalfHeightChanged (int)
 
void sldHalfWidthChanged (int)
 

Private Attributes

bool m_halfSizeLink
 
Ui_WdgBlur * m_widget
 

Additional Inherited Members

- Signals inherited from KisConfigWidget
void sigConfigurationItemChanged ()
 
void sigConfigurationUpdated ()
 
void sigDropLockedConfig (KisPropertiesConfigurationSP p)
 
void sigSaveLockedConfig (KisPropertiesConfigurationSP p)
 
- Protected Member Functions inherited from KisConfigWidget
 KisConfigWidget (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
 

Detailed Description

Definition at line 16 of file kis_wdg_blur.h.

Constructor & Destructor Documentation

◆ KisWdgBlur()

KisWdgBlur::KisWdgBlur ( QWidget * parent)

Definition at line 21 of file kis_wdg_blur.cpp.

21 : KisConfigWidget(parent)
22{
23 m_halfSizeLink = true;
24 m_widget = new Ui_WdgBlur();
25 m_widget->setupUi(this);
27
28 widget()->angleSelector->setDecimals(0);
29
30 connect(widget()->aspectButton, SIGNAL(keepAspectRatioChanged(bool)), this, SLOT(linkSpacingToggled(bool)));
31 connect(widget()->intHalfWidth, SIGNAL(valueChanged(int)), this, SLOT(sldHalfWidthChanged(int)));
32 connect(widget()->intHalfHeight, SIGNAL(valueChanged(int)), this, SLOT(sldHalfHeightChanged(int)));
33
34 widget()->aspectButton->setKeepAspectRatio(m_halfSizeLink);
35
36 connect(widget()->intStrength, SIGNAL(valueChanged(int)), SIGNAL(sigConfigurationItemChanged()));
37 connect(widget()->angleSelector, SIGNAL(angleChanged(qreal)), SIGNAL(sigConfigurationItemChanged()));
38 connect(widget()->cbShape, SIGNAL(activated(int)), SIGNAL(sigConfigurationItemChanged()));
39}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void sigConfigurationItemChanged()
KisConfigWidget(QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
void sldHalfWidthChanged(int)
Ui_WdgBlur * m_widget
const Ui_WdgBlur * widget() const
bool m_halfSizeLink
void sldHalfHeightChanged(int)
void linkSpacingToggled(bool)

References connect(), linkSpacingToggled(), m_halfSizeLink, m_widget, KisConfigWidget::sigConfigurationItemChanged(), sldHalfHeightChanged(), sldHalfWidthChanged(), and widget().

◆ ~KisWdgBlur()

KisWdgBlur::~KisWdgBlur ( )
override

Definition at line 41 of file kis_wdg_blur.cpp.

42{
43 delete m_widget;
44}

References m_widget.

Member Function Documentation

◆ configuration()

KisPropertiesConfigurationSP KisWdgBlur::configuration ( ) const
overridevirtual
Returns
the configuration

Implements KisConfigWidget.

Definition at line 46 of file kis_wdg_blur.cpp.

47{
49 config->setProperty("lockAspect", widget()->aspectButton->keepAspectRatio());
50 config->setProperty("halfWidth", widget()->intHalfWidth->value());
51 config->setProperty("halfHeight", widget()->intHalfHeight->value());
52 config->setProperty("rotate", static_cast<int>(widget()->angleSelector->angle()));
53 config->setProperty("strength", widget()->intStrength->value());
54 config->setProperty("shape", widget()->cbShape->currentIndex());
55 return config;
56}
static KisResourcesInterfaceSP instance()

References KisGlobalResourcesInterface::instance(), and widget().

◆ linkSpacingToggled

void KisWdgBlur::linkSpacingToggled ( bool b)
privateslot

Definition at line 81 of file kis_wdg_blur.cpp.

82{
84 widget()->intHalfHeight->setValue(widget()->intHalfWidth->value());
85}

References m_halfSizeLink, and widget().

◆ setConfiguration()

void KisWdgBlur::setConfiguration ( const KisPropertiesConfigurationSP config)
overridevirtual
Parameters
configthe configuration for this configuration widget.

Implements KisConfigWidget.

Definition at line 58 of file kis_wdg_blur.cpp.

59{
60 QVariant value;
61 if (config->getProperty("lockAspect", value)) {
62 m_widget->aspectButton->setKeepAspectRatio(value.toBool());
63 }
64 if (config->getProperty("shape", value)) {
65 widget()->cbShape->setCurrentIndex(value.toUInt());
66 }
67 if (config->getProperty("halfWidth", value)) {
68 widget()->intHalfWidth->setValue(value.toUInt());
69 }
70 if (config->getProperty("halfHeight", value)) {
71 widget()->intHalfHeight->setValue(value.toUInt());
72 }
73 if (config->getProperty("rotate", value)) {
74 widget()->angleSelector->setAngle(static_cast<qreal>(value.toUInt()));
75 }
76 if (config->getProperty("strength", value)) {
77 widget()->intStrength->setValue(value.toUInt());
78 }
79}
float value(const T *src, size_t ch)

References m_widget, value(), and widget().

◆ sldHalfHeightChanged

void KisWdgBlur::sldHalfHeightChanged ( int v)
privateslot

Definition at line 101 of file kis_wdg_blur.cpp.

102{
103 if (m_halfSizeLink) {
104 widget()->intHalfWidth->blockSignals(true);
105 widget()->intHalfWidth->setValue(v);
106 widget()->intHalfWidth->blockSignals(false);
107 }
108 /* if( widget()->intHalfWidth->value() == v && widget()->cbShape->currentItem() != 1)
109 widget()->intAngle->setEnabled(false);
110 else
111 widget()->intAngle->setEnabled(true);*/
113}
qreal v

References m_halfSizeLink, KisConfigWidget::sigConfigurationItemChanged(), v, and widget().

◆ sldHalfWidthChanged

void KisWdgBlur::sldHalfWidthChanged ( int v)
privateslot

Definition at line 87 of file kis_wdg_blur.cpp.

88{
89 if (m_halfSizeLink) {
90 widget()->intHalfHeight->blockSignals(true);
91 widget()->intHalfHeight->setValue(v);
92 widget()->intHalfHeight->blockSignals(false);
93 }
94 /* if( widget()->intHalfHeight->value() == v && widget()->cbShape->currentItem() != 1)
95 widget()->intAngle->setEnabled(false);
96 else
97 widget()->intAngle->setEnabled(true);*/
99}

References m_halfSizeLink, KisConfigWidget::sigConfigurationItemChanged(), v, and widget().

◆ widget()

const Ui_WdgBlur * KisWdgBlur::widget ( ) const
inline

Definition at line 22 of file kis_wdg_blur.h.

22 {
23 return m_widget;
24 }

References m_widget.

Member Data Documentation

◆ m_halfSizeLink

bool KisWdgBlur::m_halfSizeLink
private

Definition at line 36 of file kis_wdg_blur.h.

◆ m_widget

Ui_WdgBlur* KisWdgBlur::m_widget
private

Definition at line 37 of file kis_wdg_blur.h.


The documentation for this class was generated from the following files: