QGraphicsTimeChooser.hpp
1 #pragma once
2 #include <score/graphics/widgets/Constants.hpp>
3 #include <score/graphics/widgets/QGraphicsCombo.hpp>
4 #include <score/graphics/widgets/QGraphicsKnob.hpp>
5 #include <score/graphics/widgets/QGraphicsToggle.hpp>
6 
7 #include <ossia/network/value/vec.hpp>
8 
9 #include <QGraphicsItem>
10 #include <QObject>
11 
12 #include <score_lib_base_export.h>
13 
14 #include <verdigris>
15 
16 namespace score
17 {
18 class SCORE_LIB_BASE_EXPORT QGraphicsTimeChooser final
19  : public QObject
20  , public QGraphicsItem
21 {
22  W_OBJECT(QGraphicsTimeChooser)
23  SCORE_GRAPHICS_ITEM_TYPE(230)
24 
25 public:
26  QGraphicsKnob knob;
27  QGraphicsCombo combo;
28  QGraphicsToggle toggle;
29 
30  explicit QGraphicsTimeChooser(QGraphicsItem* parent);
32 
33  void syncChanged(bool sync);
34 
35  void setRect(const QRectF& r);
36  void setValue(ossia::vec2f v);
37 
38  [[nodiscard]] ossia::vec2f value() const noexcept;
39  void setExecutionValue(ossia::vec2f v);
40  void resetExecution();
41 
42  QRectF boundingRect() const override;
43 
44  void sliderMoved() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderMoved)
45  void sliderReleased() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderReleased)
46 private:
47  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
48  override;
49 };
50 }
Definition: QGraphicsCombo.hpp:18
Definition: QGraphicsKnob.hpp:16
Definition: QGraphicsTimeChooser.hpp:21
Definition: QGraphicsToggle.hpp:16
Base toolkit upon which the software is built.
Definition: Application.cpp:90