BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
combopropertyeditor.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/combopropertyeditor.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_COMBOPROPERTYEDITOR_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COMBOPROPERTYEDITOR_H
17 
19 
20 class QComboBox;
21 
22 namespace ModelView {
23 
24 //! Custom editor for QVariant based on ComboProperty.
25 
26 class MVVM_VIEWMODEL_EXPORT ComboPropertyEditor : public CustomEditor {
27  Q_OBJECT
28 
29 public:
30  explicit ComboPropertyEditor(QWidget* parent = nullptr);
31 
32  QSize sizeHint() const override;
33  QSize minimumSizeHint() const override;
34 
35  bool is_persistent() const override;
36 
37 protected slots:
38  virtual void onIndexChanged(int index);
39 
40 private:
41  std::vector<std::string> internLabels();
42  int internIndex();
43  void setConnected(bool isConnected);
44  void update_components() override;
45  QComboBox* m_box;
46 };
47 
48 } // namespace ModelView
49 
50 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COMBOPROPERTYEDITOR_H
Custom editor for QVariant based on ComboProperty.
Base class for all custom variant editors.
Definition: customeditor.h:26
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.