#include "legendscrollbutton_p.h" #include "qlegend.h" #include QTCOMMERCIALCHART_BEGIN_NAMESPACE LegendScrollButton::LegendScrollButton(ScrollButtonId id, QLegend *legend) : QGraphicsPolygonItem(legend), m_id(id), m_ledgend(legend) { setAcceptedMouseButtons(Qt::LeftButton); } LegendScrollButton::ScrollButtonId LegendScrollButton::id() { return m_id; } void LegendScrollButton::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); m_ledgend->scrollButtonClicked(this); } QTCOMMERCIALCHART_END_NAMESPACE