BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
externalproperty.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/model/mvvm/model/externalproperty.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_MODEL_MVVM_MODEL_EXTERNALPROPERTY_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_MODEL_EXTERNALPROPERTY_H
17 
18 #include "mvvm/core/variant.h"
19 #include "mvvm/model_export.h"
20 #include <QColor>
21 #include <string>
22 
23 namespace ModelView {
24 
25 //! Property to carry text, color and identifier.
26 //! Can be used to link items with each other.
27 
28 class MVVM_MODEL_EXPORT ExternalProperty {
29 public:
31  ExternalProperty(std::string text, QColor color, std::string id = {});
32 
33  static ExternalProperty undefined();
34 
35  std::string text() const;
36 
37  QColor color() const;
38 
39  std::string identifier() const;
40 
41  bool isValid() const;
42 
43  bool operator==(const ExternalProperty& other) const;
44  bool operator!=(const ExternalProperty& other) const;
45  bool operator<(const ExternalProperty& other) const;
46 
47 private:
48  std::string m_text;
49  QColor m_color;
50  std::string m_identifier;
51 };
52 
53 } // namespace ModelView
54 
55 Q_DECLARE_METATYPE(ModelView::ExternalProperty)
56 
57 #endif // BORNAGAIN_MVVM_MODEL_MVVM_MODEL_EXTERNALPROPERTY_H
bool operator<(const CumulativeValue &lhs, const CumulativeValue &rhs)
bool operator!=(const Material &left, const Material &right)
Comparison operator for material wrapper (inequality check)
Definition: Material.cpp:126
bool operator==(const Material &left, const Material &right)
Comparison operator for material wrapper (equality check)
Definition: Material.cpp:113
Property to carry text, color and identifier.
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?