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 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/MaterialEditor/ExternalProperty.h
6 //! @brief Defines class ExternalProperty
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_EXTERNALPROPERTY_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_EXTERNALPROPERTY_H
17 
18 #include <QColor>
19 #include <QMetaType>
20 #include <QPixmap>
21 #include <QString>
22 #include <QVariant>
23 
24 //! The ExternalProperty class defines custom QVariant property to carry the text, color and
25 //! an identifier.
26 
28 public:
29  explicit ExternalProperty();
30 
31  QString text() const;
32  void setText(const QString& name);
33 
34  QColor color() const;
35  void setColor(const QColor& color);
36 
37  QString identifier() const;
38  void setIdentifier(const QString& identifier);
39 
40  QPixmap pixmap() const;
41 
42  bool isValid() const;
43 
44  QVariant variant() const;
45 
46  bool operator==(const ExternalProperty& other) const;
47  bool operator!=(const ExternalProperty& other) const;
48  bool operator<(const ExternalProperty& other) const;
49 
50 private:
51  QString m_text;
52  QColor m_color;
53  QString m_identifier;
54 };
55 
56 Q_DECLARE_METATYPE(ExternalProperty)
57 
58 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_EXTERNALPROPERTY_H
The ExternalProperty class defines custom QVariant property to carry the text, color and an identifie...
QString identifier() const
QVariant variant() const
void setColor(const QColor &color)
bool operator<(const ExternalProperty &other) const
bool operator==(const ExternalProperty &other) const
QString text() const
bool operator!=(const ExternalProperty &other) const
QPixmap pixmap() const
void setText(const QString &name)
bool isValid() const
Returns true if property is in valid state (i.e. have at least one member defined).
void setIdentifier(const QString &identifier)
QColor color() const
QString const & name(EShape k)
Definition: particles.cpp:21