AddressBarItem.hpp
1 #pragma once
2 #include <Scenario/Document/Interval/IntervalModel.hpp>
3 
4 #include <score/model/path/ObjectPath.hpp>
5 
6 #include <QGraphicsItem>
7 #include <QList>
8 #include <QRect>
9 
10 #include <verdigris>
11 
12 class QPainter;
13 class QStyleOptionGraphicsItem;
14 class QWidget;
15 
16 namespace Scenario
17 {
18 class IntervalModel;
19 class ClickableLabelItem;
20 class AddressBarItem final
21  : public QObject
22  , public QGraphicsItem
23 {
24  W_OBJECT(AddressBarItem)
25  Q_INTERFACES(QGraphicsItem)
26 public:
27  AddressBarItem(const score::DocumentContext& ctx, QGraphicsItem* parent);
28 
29  double width() const;
30  void setTargetObject(ObjectPath&&);
31 
32  QRectF boundingRect() const override;
33  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
34  override;
35 
36 public:
37  void needRedraw() W_SIGNAL(needRedraw);
38  void intervalSelected(IntervalModel* cst) W_SIGNAL(intervalSelected, cst);
39 
40 private:
41  void redraw();
42  QList<QGraphicsItem*> m_items;
43  ObjectPath m_currentPath;
44  const score::DocumentContext& m_ctx;
45 
46  double m_width{};
47 };
48 }
The ObjectPath class.
Definition: ObjectPath.hpp:37
Definition: AddressBarItem.hpp:23
Definition: IntervalModel.hpp:50
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DocumentContext.hpp:18