2#include <score/graphics/DefaultGraphicsSliderImpl.hpp>
3#include <score/graphics/GraphicWidgets.hpp>
4#include <score/widgets/DoubleSpinBox.hpp>
5#include <score/widgets/SignalUtils.hpp>
7#include <QGraphicsProxyWidget>
12QGraphicsSliderBase<T>::QGraphicsSliderBase(QGraphicsItem* parent)
13 : QGraphicsItem{parent}
14 , impl{new RightClickImpl}
16 this->setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
20QGraphicsSliderBase<T>::~QGraphicsSliderBase()
22 if(this->impl->spinbox || this->impl->spinboxProxy)
23 delete this->impl->spinboxProxy;
28QRectF QGraphicsSliderBase<T>::boundingRect()
const
34bool QGraphicsSliderBase<T>::isInHandle(QPointF p)
36 return m_rect.contains(p);
40double QGraphicsSliderBase<T>::getHandleX()
const
42 return sliderRect().width() *
static_cast<const T&
>(*this).m_value;
46double QGraphicsSliderBase<T>::getExecHandleX()
const
48 return sliderRect().width() *
static_cast<const T&
>(*this).m_execValue;
52QRectF QGraphicsSliderBase<T>::sliderRect()
const
54 return QRectF{0, 0, m_rect.width(), 8};
58QRectF QGraphicsSliderBase<T>::handleRect()
const
60 auto r = sliderRect();
61 r.setWidth(std::max(0.,
static_cast<const T&
>(*this).getHandleX()));
65QRectF QGraphicsSliderBase<T>::execHandleRect()
const
67 return {0, 6,
static_cast<const T&
>(*this).getExecHandleX(), 2};
71void QGraphicsSliderBase<T>::setRect(
const QRectF& r)
73 prepareGeometryChange();
Base toolkit upon which the software is built.
Definition Application.cpp:90