Krita Source Code Documentation
Loading...
Searching...
No Matches
MultinodePropertyBoolConnector< PropertyAdapter > Class Template Reference

#include <kis_multinode_property.h>

+ Inheritance diagram for MultinodePropertyBoolConnector< PropertyAdapter >:

Public Member Functions

void connectIgnoreCheckBox (QCheckBox *ignoreBox) override
 
 MultinodePropertyBoolConnector (PropertyType *parent)
 
void notifyIgnoreChanged () override
 
void notifyValueChanged () override
 
- Public Member Functions inherited from MultinodePropertyConnectorInterface
virtual void connectAutoEnableWidget (QWidget *widget)
 
void connectValueChangedSignal (const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoConnection)
 
 ~MultinodePropertyConnectorInterface () override
 

Protected Member Functions

void slotIgnoreCheckBoxChanged (int state) override
 

Private Types

typedef KisMultinodeProperty< PropertyAdapter > PropertyType
 

Private Attributes

QPointer< QCheckBox > m_ignoreBox
 
PropertyTypem_parent
 

Additional Inherited Members

- Signals inherited from MultinodePropertyConnectorInterface
void sigValueChanged ()
 
- Protected Slots inherited from MultinodePropertyConnectorInterface

Detailed Description

template<class PropertyAdapter>
class MultinodePropertyBoolConnector< PropertyAdapter >

Definition at line 351 of file kis_multinode_property.h.

Member Typedef Documentation

◆ PropertyType

template<class PropertyAdapter >
typedef KisMultinodeProperty<PropertyAdapter> MultinodePropertyBoolConnector< PropertyAdapter >::PropertyType
private

Definition at line 353 of file kis_multinode_property.h.

Constructor & Destructor Documentation

◆ MultinodePropertyBoolConnector()

template<class PropertyAdapter >
MultinodePropertyBoolConnector< PropertyAdapter >::MultinodePropertyBoolConnector ( PropertyType * parent)
inline

Definition at line 355 of file kis_multinode_property.h.

356 : m_parent(parent)
357 {
358 }

Member Function Documentation

◆ connectIgnoreCheckBox()

template<class PropertyAdapter >
void MultinodePropertyBoolConnector< PropertyAdapter >::connectIgnoreCheckBox ( QCheckBox * ignoreBox)
inlineoverridevirtual

Public interface

Implements MultinodePropertyConnectorInterface.

Definition at line 360 of file kis_multinode_property.h.

360 {
361 m_ignoreBox = ignoreBox;
362
365
366 m_ignoreBox->setTristate(false);
367 } else {
368 m_ignoreBox->setTristate(true);
369 }
370 connect(m_ignoreBox, SIGNAL(stateChanged(int)), SLOT(slotIgnoreCheckBoxChanged(int)));
371 }
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
bool savedValuesDiffer() const override
bool isIgnored() const override
bool haveTheOnlyNode() const override
void slotIgnoreCheckBoxChanged(int state) override

References connect(), KisMultinodeProperty< PropertyAdapter >::haveTheOnlyNode(), KisMultinodeProperty< PropertyAdapter >::isIgnored(), MultinodePropertyBoolConnector< PropertyAdapter >::m_ignoreBox, MultinodePropertyBoolConnector< PropertyAdapter >::m_parent, KisMultinodeProperty< PropertyAdapter >::savedValuesDiffer(), and MultinodePropertyBoolConnector< PropertyAdapter >::slotIgnoreCheckBoxChanged().

◆ notifyIgnoreChanged()

template<class PropertyAdapter >
void MultinodePropertyBoolConnector< PropertyAdapter >::notifyIgnoreChanged ( )
inlineoverridevirtual

Implements MultinodePropertyConnectorInterface.

Definition at line 373 of file kis_multinode_property.h.

373 {
374 // noop
375 }

◆ notifyValueChanged()

template<class PropertyAdapter >
void MultinodePropertyBoolConnector< PropertyAdapter >::notifyValueChanged ( )
inlineoverridevirtual

Interface for KisMultinodeProperty's notifications

Reimplemented from MultinodePropertyConnectorInterface.

Definition at line 377 of file kis_multinode_property.h.

377 {
378 if (m_ignoreBox) {
379 Qt::CheckState newState =
380 m_parent->isIgnored() ? Qt::PartiallyChecked :
381 bool(m_parent->value()) ? Qt::Checked :
382 Qt::Unchecked;
383
384 if (m_ignoreBox->checkState() != newState) {
385 m_ignoreBox->setCheckState(newState);
386 }
387 }
389 }

References KisMultinodeProperty< PropertyAdapter >::isIgnored(), MultinodePropertyBoolConnector< PropertyAdapter >::m_ignoreBox, MultinodePropertyBoolConnector< PropertyAdapter >::m_parent, MultinodePropertyConnectorInterface::notifyValueChanged(), and KisMultinodeProperty< PropertyAdapter >::value().

◆ slotIgnoreCheckBoxChanged()

template<class PropertyAdapter >
void MultinodePropertyBoolConnector< PropertyAdapter >::slotIgnoreCheckBoxChanged ( int state)
inlineoverrideprotectedvirtual

Implements MultinodePropertyConnectorInterface.

Definition at line 391 of file kis_multinode_property.h.

391 {
392 if (state == Qt::PartiallyChecked) {
393 m_parent->setIgnored(true);
394 } else {
395 m_parent->setIgnored(false);
396 m_parent->setValue(bool(state == Qt::Checked));
397 }
398 }
void setValue(const ValueType &value)
void setIgnored(bool value) override

References MultinodePropertyBoolConnector< PropertyAdapter >::m_parent, KisMultinodeProperty< PropertyAdapter >::setIgnored(), and KisMultinodeProperty< PropertyAdapter >::setValue().

Member Data Documentation

◆ m_ignoreBox

template<class PropertyAdapter >
QPointer<QCheckBox> MultinodePropertyBoolConnector< PropertyAdapter >::m_ignoreBox
private

Definition at line 401 of file kis_multinode_property.h.

◆ m_parent

template<class PropertyAdapter >
PropertyType* MultinodePropertyBoolConnector< PropertyAdapter >::m_parent
private

Definition at line 402 of file kis_multinode_property.h.


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