BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
handleelementview.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/sldeditor/handleelementview.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 Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_SLDEDITOR_HANDLEELEMENTVIEW_H
16 #define BORNAGAIN_GUI2_SLDEDITOR_HANDLEELEMENTVIEW_H
17 
18 #include "darefl_export.h"
20 
21 #include <QBrush>
22 #include <QPen>
23 #include <QRectF>
24 
25 namespace gui2 {
26 
27 class LayerElementController;
28 
29 //! The handle QGraphicsViewItem on GraphicsScene
30 class DAREFLCORE_EXPORT HandleElementView : public ElementView {
31 public:
33  QRectF boundingRect() const override;
34  QPainterPath shape() const override;
35  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
36 
37  void setLayerElementController(LayerElementController* controller);
38  void setRectangle(QRectF rectangle);
39  void setBrush(QBrush brush);
40  void setPen(QPen pen);
41  QPointF getLastPos() const;
42 
43 public:
44  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
45 
46 protected:
48  QPointF m_pos;
49  QRectF m_rectangle;
50  QBrush m_brush;
51  QPen m_pen;
52 };
53 
54 } // namespace gui2
55 
56 #endif // BORNAGAIN_GUI2_SLDEDITOR_HANDLEELEMENTVIEW_H
The interface of any QGraphicsViewItem on GraphicsScene to the Sceneadapter.
Definition: elementview.h:26
The handle QGraphicsViewItem on GraphicsScene.
LayerElementController * p_controller
Manages the whole appearance of a layer on the graphicsscene.
Defines class CLASS?
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20