2 #include <score/graphics/widgets/Constants.hpp>
4 #include <QGraphicsItem>
7 #include <score_lib_base_export.h>
12 struct DefaultGraphicsSpinboxImpl;
15 ,
public QGraphicsItem
18 Q_INTERFACES(QGraphicsItem)
22 QRectF m_rect{0., 0., 40., 20.};
25 float m_value{}, m_execValue{};
34 void setValue(
float r);
35 void setExecutionValue(
float r);
36 void resetExecution();
37 void setRange(
float min,
float max);
42 double unmap(
double v)
const noexcept {
return (v - min) / (max - min); }
43 double map(
double v)
const noexcept {
return (v * (max - min)) + min; }
46 void sliderMoved() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderMoved)
47 void sliderReleased() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderReleased)
50 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
override;
51 void mousePressEvent(QGraphicsSceneMouseEvent* event)
override;
52 void mouseMoveEvent(QGraphicsSceneMouseEvent* event)
override;
53 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
override;
54 QRectF boundingRect()
const override;
55 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget)
61 ,
public QGraphicsItem
64 Q_INTERFACES(QGraphicsItem)
68 QRectF m_rect{0., 0., 40., 20.};
71 double m_value{}, m_execValue{};
80 void setValue(
double r);
81 void setExecutionValue(
double r);
82 void resetExecution();
83 void setRange(
double min,
double max);
88 double unmap(
double v)
const noexcept
90 return (
double(v) -
double(min)) / (double(max) - double(min));
92 double map(
double v)
const noexcept
94 return (
double(v) * (
double(max) -
double(min))) + double(min);
98 void sliderMoved() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderMoved)
99 void sliderReleased() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderReleased)
102 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
override;
103 void mousePressEvent(QGraphicsSceneMouseEvent* event)
override;
104 void mouseMoveEvent(QGraphicsSceneMouseEvent* event)
override;
105 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
override;
106 QRectF boundingRect()
const override;
107 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget)
Definition: QGraphicsSpinbox.hpp:62
Definition: QGraphicsSpinbox.hpp:16
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DefaultGraphicsSpinboxImpl.hpp:22