BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
scientificdoubleeditor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/viewmodel/mvvm/editors/scientificdoubleeditor.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_SCIENTIFICDOUBLEEDITOR_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_SCIENTIFICDOUBLEEDITOR_H
17 
19 
20 class QLineEdit;
21 class QDoubleValidator;
22 
23 namespace ModelView {
24 
25 //! Custom editor for QVariant based on double with scientific notation support.
26 
27 class MVVM_VIEWMODEL_EXPORT ScientificDoubleEditor : public CustomEditor {
28  Q_OBJECT
29 
30 public:
31  explicit ScientificDoubleEditor(QWidget* parent = nullptr);
32 
33  void setRange(double minimum, double maximum);
34 
35 private slots:
36  void onEditingFinished();
37 
38 private:
39  void update_components() override;
40  QLineEdit* m_lineEdit;
41  QDoubleValidator* m_validator{nullptr};
42 };
43 
44 } // namespace ModelView
45 
46 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_SCIENTIFICDOUBLEEDITOR_H
Base class for all custom variant editors.
Definition: customeditor.h:26
Custom editor for QVariant based on double with scientific notation support.
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.