BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
externalproperty.cpp
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.cpp
6 //! @brief Implements 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 
16 
17 using namespace ModelView;
18 
20 
21 ExternalProperty::ExternalProperty(std::string text, QColor color, std::string id)
22  : m_text(std::move(text)), m_color(std::move(color)), m_identifier(std::move(id))
23 {
24 }
25 
27 {
28  return ExternalProperty("Undefined", QColor(Qt::red));
29 }
30 
31 std::string ExternalProperty::text() const
32 {
33  return m_text;
34 }
35 
37 {
38  return m_color;
39 }
40 
41 std::string ExternalProperty::identifier() const
42 {
43  return m_identifier;
44 }
45 
47 {
48  return !(m_identifier.empty() && m_text.empty() && !m_color.isValid());
49 }
50 
52 {
53  return m_identifier == other.m_identifier && m_text == other.m_text && m_color == other.m_color;
54 }
55 
57 {
58  return !(*this == other);
59 }
60 
62 {
63  return m_identifier < other.m_identifier && m_text < other.m_text
64  && m_color.name() < other.m_color.name();
65 }
Property to carry text, color and identifier.
static ExternalProperty undefined()
bool operator<(const ExternalProperty &other) const
bool operator==(const ExternalProperty &other) const
bool operator!=(const ExternalProperty &other) const
std::string identifier() const
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Definition: filesystem.h:81