diff --git a/GUI/View/Common/FixupDoubleValidator.h b/GUI/View/Common/FixupDoubleValidator.h index 2628fbce623b8947c95fd67adcd977e26dd135e9..d0ba632bf9841431dc5ed647c5d335057bf10dd7 100644 --- a/GUI/View/Common/FixupDoubleValidator.h +++ b/GUI/View/Common/FixupDoubleValidator.h @@ -17,6 +17,10 @@ #include <QDoubleValidator> +//! The FixupDoubleValidator class is a derivative of QDoubleValidator with non-empty "fixup" +//! method. If validator return QValidator::Intermediate, then "fixup" lets us know about that, +//! emiting fixupSignal(); + class FixupDoubleValidator : public QDoubleValidator { Q_OBJECT public: diff --git a/GUI/View/Instrument/GISASBeamEditor.cpp b/GUI/View/Instrument/GISASBeamEditor.cpp index e645aaf147e851a578a49b99633737b682bd701c..e97a8aa0deff92a68a3ef5fc96bd85ad133c0d8f 100644 --- a/GUI/View/Instrument/GISASBeamEditor.cpp +++ b/GUI/View/Instrument/GISASBeamEditor.cpp @@ -68,7 +68,7 @@ GISASBeamEditor::GISASBeamEditor(QWidget* parent, BeamItem* item) connect(azimuthalEditor, &DistributionEditor::distributionChanged, this, &GISASBeamEditor::dataChanged); - //! validate value while typing + // validate value while typing connect(intensityEditor, &QLineEdit::textEdited, [=]() { QString str = intensityEditor->text(); int pos; @@ -77,8 +77,8 @@ GISASBeamEditor::GISASBeamEditor(QWidget* parent, BeamItem* item) emit dataChanged(); } }); - //! if validator does not assert the input value, it says about that, - //! and here we return to the last correct value + // if validator does not assert the input value, it says about that, + // and here we return to the last correct value connect(validator, &FixupDoubleValidator::fixupSignal, [=]() { auto* editor = qobject_cast<QLineEdit*>(validator->parent()); editor->setText(QString::number(item->intensity(),'g')); diff --git a/GUI/View/Instrument/OffSpecularBeamEditor.cpp b/GUI/View/Instrument/OffSpecularBeamEditor.cpp index e63e910e1ad550ec5313282430e19309f6fe41f3..ecefda782e53371934fd5ec1c53e235ba37dd186 100644 --- a/GUI/View/Instrument/OffSpecularBeamEditor.cpp +++ b/GUI/View/Instrument/OffSpecularBeamEditor.cpp @@ -68,7 +68,7 @@ OffSpecularBeamEditor::OffSpecularBeamEditor(QWidget* parent, OffSpecularInstrum connect(azimuthalEditor, &DistributionEditor::distributionChanged, this, &OffSpecularBeamEditor::dataChanged); - //! validate value while typing + // validate value while typing connect(intensityEditor, &QLineEdit::textEdited, [=]() { QString str = intensityEditor->text(); int pos; @@ -77,8 +77,8 @@ OffSpecularBeamEditor::OffSpecularBeamEditor(QWidget* parent, OffSpecularInstrum emit dataChanged(); } }); - //! if validator does not assert the input value, it says about that, - //! and here we return to the last correct value + // if validator does not assert the input value, it says about that, + // and here we return to the last correct value connect(validator, &FixupDoubleValidator::fixupSignal, [=]() { auto* editor = qobject_cast<QLineEdit*>(validator->parent()); editor->setText(QString::number(item->beamItem()->intensity(),'g')); diff --git a/GUI/View/Instrument/SpecularBeamEditor.cpp b/GUI/View/Instrument/SpecularBeamEditor.cpp index 0185fce64988dd28b91d432525f9b22fe71da14a..3b67acc80a3e51e68dbb54a6fffe3978274f22c1 100644 --- a/GUI/View/Instrument/SpecularBeamEditor.cpp +++ b/GUI/View/Instrument/SpecularBeamEditor.cpp @@ -78,7 +78,7 @@ SpecularBeamEditor::SpecularBeamEditor(QWidget* parent, SpecularBeamItem* item, connect(footprintEditor, &FootprintCorrectionEditor::dataChanged, this, &SpecularBeamEditor::dataChanged); - //! validate value while typing + // validate value while typing connect(intensityLineEdit, &QLineEdit::textEdited, [=]() { QString str = intensityLineEdit->text(); int pos; @@ -87,8 +87,8 @@ SpecularBeamEditor::SpecularBeamEditor(QWidget* parent, SpecularBeamItem* item, emit dataChanged(); } }); - //! if validator does not assert the input value, it says about that, - //! and here we return to the last correct value + // if validator does not assert the input value, it says about that, + // and here we return to the last correct value connect(validator, &FixupDoubleValidator::fixupSignal, [=]() { auto* editor = qobject_cast<QLineEdit*>(validator->parent()); editor->setText(QString::number(item->intensity(),'g'));