OGS
VtkAlgorithmPropertyCheckbox Class Reference

Detailed Description

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

Definition at line 12 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.
 ~VtkAlgorithmPropertyCheckbox () override
 Destructor.

Private Slots

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

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 11 of file VtkAlgorithmPropertyCheckbox.cpp.

16 : QCheckBox(parent), _name(std::move(name)), _algProps(algProps)
17{
18 this->setChecked(value);
19 connect(this, SIGNAL(stateChanged(int)), this, SLOT(setNewValue(int)));
20}
void setNewValue(int state)
This slots is automatically called when the checkbox state changed.

References _algProps, _name, and 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 24 of file VtkAlgorithmPropertyCheckbox.cpp.

25{
26 auto boolState = static_cast<bool>(state);
27 _algProps->SetUserProperty(_name, QVariant(boolState));
28}

References _algProps, and _name.

Referenced by VtkAlgorithmPropertyCheckbox().

Member Data Documentation

◆ _algProps

VtkAlgorithmProperties* VtkAlgorithmPropertyCheckbox::_algProps
private

Definition at line 31 of file VtkAlgorithmPropertyCheckbox.h.

Referenced by VtkAlgorithmPropertyCheckbox(), and setNewValue().

◆ _name

const QString VtkAlgorithmPropertyCheckbox::_name
private

Definition at line 30 of file VtkAlgorithmPropertyCheckbox.h.

Referenced by VtkAlgorithmPropertyCheckbox(), and setNewValue().


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