BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
coloreditor.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/coloreditor.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_COLOREDITOR_H
16 #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COLOREDITOR_H
17 
19 
20 class QLabel;
21 
22 namespace ModelView {
23 
24 class LostFocusFilter;
25 
26 //! Custom editor for QVariant based on QColor.
27 
28 class MVVM_VIEWMODEL_EXPORT ColorEditor : public CustomEditor {
29  Q_OBJECT
30 
31 public:
32  explicit ColorEditor(QWidget* parent = nullptr);
33 
34 protected:
35  void mousePressEvent(QMouseEvent* event) override;
36 
37 private:
38  QColor currentColor() const;
39 
40  void update_components() override;
41  QLabel* m_textLabel{nullptr};
42  QLabel* m_pixmapLabel{nullptr};
44 };
45 
46 } // namespace ModelView
47 
48 #endif // BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_COLOREDITOR_H
Event filter to prevent lost of focus by custom material editor.
Custom editor for QVariant based on QColor.
Definition: coloreditor.h:28
LostFocusFilter * m_focusFilter
Definition: coloreditor.h:43
Base class for all custom variant editors.
Definition: customeditor.h:26
Event filter to prevent loss of the focus.
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.