BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FixupDoubleValidator.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Common/FixupDoubleValidator.h
6 //! @brief Defines class FixupDoubleValidator
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_VIEW_COMMON_FIXUPDOUBLEVALIDATOR_H
16 #define BORNAGAIN_GUI_VIEW_COMMON_FIXUPDOUBLEVALIDATOR_H
17 
18 #include <QDoubleValidator>
19 
20 //! The FixupDoubleValidator class is a derivative of QDoubleValidator with non-empty "fixup"
21 //! method. If the validator return QValidator::Intermediate, then "fixup" lets us know about that,
22 //! emiting fixupSignal().
23 
24 class FixupDoubleValidator : public QDoubleValidator {
25  Q_OBJECT
26 public:
27  explicit FixupDoubleValidator(QObject* parent = nullptr);
28  FixupDoubleValidator(double bottom, double top, int decimals, QObject* parent = nullptr);
29 
30  virtual void fixup(QString& input) const override;
31 
32 signals:
33  void fixupSignal() const;
34 };
35 
36 #endif // BORNAGAIN_GUI_VIEW_COMMON_FIXUPDOUBLEVALIDATOR_H
The FixupDoubleValidator class is a derivative of QDoubleValidator with non-empty "fixup" method....
void fixupSignal() const
virtual void fixup(QString &input) const override
FixupDoubleValidator(QObject *parent=nullptr)