ConditionView.hpp
1 #pragma once
2 #include <Scenario/Document/Event/ExecutionStatus.hpp>
3 #include <Scenario/Document/ScenarioDocument/ScenarioDocumentViewConstants.hpp>
4 
5 #include <score/model/ColorReference.hpp>
6 
7 #include <QGraphicsItem>
8 #include <QPainterPath>
9 #include <QRect>
10 
11 #include <score_plugin_scenario_export.h>
12 
13 #include <verdigris>
14 
15 namespace Scenario
16 {
17 class EventModel;
18 class SCORE_PLUGIN_SCENARIO_EXPORT ConditionView final
19  : public QObject
20  , public QGraphicsItem
21 {
22  W_OBJECT(ConditionView)
23  Q_INTERFACES(QGraphicsItem)
24 public:
25  ConditionView(const EventModel& m, QGraphicsItem* parent);
26 
27  QRectF boundingRect() const override;
28  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
29  override;
30  void changeHeight(qreal newH);
31 
32  void setSelected(bool selected);
33 
34  static const constexpr int Type = ItemType::Condition;
35  int type() const final override { return Type; }
36 
37 public:
38  void pressed(QPointF arg_1) W_SIGNAL(pressed, arg_1);
39 
40 private:
41  void setHeight(qreal);
42 
43  QPainterPath shape() const override;
44  bool contains(const QPointF& point) const override;
45  QPainterPath opaqueArea() const override;
46  void mousePressEvent(QGraphicsSceneMouseEvent*) override;
47 
48  const EventModel& m_model;
49  QPainterPath m_Cpath;
50  QPainterPath m_strokedCpath;
51  qreal m_height{0.};
52  bool m_selected{false};
53 };
54 }
Definition: ConditionView.hpp:21
Definition: EventModel.hpp:36
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14