OGS
VtkAlgorithmPropertyCheckbox Class Reference

Detailed Description

This checkbox sets a user property on the given VtkAlgorithmProperties object automatically.

Definition at line 23 of file VtkAlgorithmPropertyCheckbox.h.

#include <VtkAlgorithmPropertyCheckbox.h>

Inheritance diagram for VtkAlgorithmPropertyCheckbox:
[legend]
Collaboration diagram for VtkAlgorithmPropertyCheckbox:
[legend]

Public Member Functions

 VtkAlgorithmPropertyCheckbox (const bool value, QString name, VtkAlgorithmProperties *algProps, QWidget *parent=nullptr)
 Constructor. More...
 
 ~VtkAlgorithmPropertyCheckbox () override
 Destructor. More...
 

Private Slots

void setNewValue (int state)
 This slots is automatically called when the checkbox state changed. More...
 

Private Attributes

const QString _name
 
VtkAlgorithmProperties_algProps
 

Constructor & Destructor Documentation

◆ VtkAlgorithmPropertyCheckbox()

VtkAlgorithmPropertyCheckbox::VtkAlgorithmPropertyCheckbox ( const bool  value,
QString  name,
VtkAlgorithmProperties algProps,
QWidget *  parent = nullptr 
)

Constructor.

Parameters
valueThe initial check state.
nameThe name of the user property to set.
algPropsThe VtkAlgorithmProperties object.
parentThe parent widget.

Definition at line 22 of file VtkAlgorithmPropertyCheckbox.cpp.

27  : QCheckBox(parent), _name(std::move(name)), _algProps(algProps)
28 {
29  this->setChecked(value);
30  connect(this, SIGNAL(stateChanged(int)), this, SLOT(setNewValue(int)));
31 }
void setNewValue(int state)
This slots is automatically called when the checkbox state changed.

References setNewValue().

◆ ~VtkAlgorithmPropertyCheckbox()

VtkAlgorithmPropertyCheckbox::~VtkAlgorithmPropertyCheckbox ( )
overridedefault

Destructor.

Member Function Documentation

◆ setNewValue

void VtkAlgorithmPropertyCheckbox::setNewValue ( int  state)
privateslot

This slots is automatically called when the checkbox state changed.

Definition at line 35 of file VtkAlgorithmPropertyCheckbox.cpp.

36 {
37  auto boolState = static_cast<bool>(state);
38  _algProps->SetUserProperty(_name, QVariant(boolState));
39 }
virtual void SetUserProperty(QString name, QVariant value)
Sets a user property. This should be implemented by subclasses.

References _algProps, _name, and VtkAlgorithmProperties::SetUserProperty().

Referenced by VtkAlgorithmPropertyCheckbox().

Member Data Documentation

◆ _algProps

VtkAlgorithmProperties* VtkAlgorithmPropertyCheckbox::_algProps
private

Definition at line 42 of file VtkAlgorithmPropertyCheckbox.h.

Referenced by setNewValue().

◆ _name

const QString VtkAlgorithmPropertyCheckbox::_name
private

Definition at line 41 of file VtkAlgorithmPropertyCheckbox.h.

Referenced by setNewValue().


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