| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassGui
- ToleranceWidget

# MsXpS::libXpertMassGui::ToleranceWidget Class

class MsXpS::libXpertMassGui::ToleranceWidget

The ToleranceWidget class provides a widget for the configuration of the mass tolerance. More...

Header: | `#include <ToleranceWidget.hpp>`

- List of all members, including inherited members
- ToleranceWidget is part of libXpertMassGui Mass calculations.

## Public Functions

| ToleranceWidget(QWidget *parent_p, const QString &config_settings_file_path)
| ToleranceWidget(QWidget *parent, const QString &config_settings_file_path, double nominal, MsXpS::libXpertMassCore::Tolerance::Type type)
| ~ToleranceWidget()
double | getNominal() const
MsXpS::libXpertMassCore::Tolerance::Type | getType() const
void | readSettings(const QString &config_settings_file_path)
void | setNominal(double nominal)
void | setType(MsXpS::libXpertMassCore::Tolerance::Type type)
void | writeSettings(const QString &config_settings_file_path)

## Public Slots

void | nominalDoubleSpinBoxValueChanged(double value)
void | typeComboBoxValueChanged(const QString &text)

## Detailed Description

This composite widget contains all the widgets and all the logic required to fully configure the mass peak tolerance.

## Member Function Documentation

### ToleranceWidget::ToleranceWidget(QWidget *parent_p, const QString &config_settings_file_path)

Constructs a ToleranceWidget instance.

- parent_p: the parent widget.
- config_settings_file_path: the path to the configuration settings file

### ToleranceWidget::ToleranceWidget(QWidget *parent, const QString &config_settings_file_path, double nominal, MsXpS::libXpertMassCore::Tolerance::Type type)

Constructs a ToleranceWidget instance.

- parent_p: the parent widget.
- config_settings_file_path: the QSettings configuration file path
- nominal: the nominal libXpertMassCore::Tolerance value
- type: the libXpertMassCore::Tolerance::Type type

### `[noexcept]` ToleranceWidget::~ToleranceWidget()

Destructs this ToleranceWidget instance.

### `[invokable]` double ToleranceWidget::getNominal() const

Returns the Tolerance nominal value.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` MsXpS::libXpertMassCore::Tolerance::Type ToleranceWidget::getType() const

Returns the Tolerance type .

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[slot]` void ToleranceWidget::nominalDoubleSpinBoxValueChanged(double value)

Signals that the nominal value is now value.

### void ToleranceWidget::readSettings(const QString &config_settings_file_path)

Reads the settings of this widget from config_settings_file_path.

Tolerance settings are tried from the settings. If not found, the default values for nominal and tolerance type are set.

### `[invokable]` void ToleranceWidget::setNominal(double nominal)

Sets the Tolerance nominal value to nominal.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void ToleranceWidget::setType(MsXpS::libXpertMassCore::Tolerance::Type type)

Sets the Tolerance type to type.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[slot]` void ToleranceWidget::typeComboBoxValueChanged(const QString &text)

Signals that the Tolerance type is now described as text.

### void ToleranceWidget::writeSettings(const QString &config_settings_file_path)

Writes the settings of this widget to config_settings_file_path for later restoration.