BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
scientificspinboxeditor.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/scientificspinboxeditor.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_SCIENTIFICSPINBOXEDITOR_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_SCIENTIFICSPINBOXEDITOR_H
17 
19 
20 namespace ModelView {
21 
22 class ScientificSpinBox;
23 
24 //! Custom editor for QVariant based on double with scientific notation support.
25 
26 class MVVM_VIEWMODEL_EXPORT ScientificSpinBoxEditor : public CustomEditor {
27  Q_OBJECT
28 
29 public:
30  explicit ScientificSpinBoxEditor(QWidget* parent = nullptr);
31 
32  void setRange(double minimum, double maximum);
33  void setDecimals(int decimals);
34  void setSingleStep(double step);
35 
36  bool is_persistent() const override;
37 
38 private slots:
39  void onEditingFinished();
40 
41 private:
42  void update_components() override;
44 };
45 
46 } // namespace ModelView
47 
48 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_SCIENTIFICSPINBOXEDITOR_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.