legendscrollbutton.cpp
28 lines
| 577 B
| text/x-c
|
CppLexer
/ src / legendscrollbutton.cpp
sauimone
|
r716 | #include "legendscrollbutton_p.h" | ||
Michal Klocek
|
r790 | #include "qlegend.h" | ||
sauimone
|
r716 | #include <QGraphicsSceneEvent> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Michal Klocek
|
r790 | LegendScrollButton::LegendScrollButton(ScrollButtonId id, QLegend *legend) | ||
: QGraphicsPolygonItem(legend), | ||||
m_id(id), | ||||
m_ledgend(legend) | ||||
sauimone
|
r716 | { | ||
setAcceptedMouseButtons(Qt::LeftButton); | ||||
} | ||||
LegendScrollButton::ScrollButtonId LegendScrollButton::id() | ||||
{ | ||||
sauimone
|
r778 | return m_id; | ||
sauimone
|
r716 | } | ||
void LegendScrollButton::mousePressEvent(QGraphicsSceneMouseEvent *event) | ||||
{ | ||||
Michal Klocek
|
r790 | Q_UNUSED(event); | ||
m_ledgend->scrollButtonClicked(this); | ||||
sauimone
|
r716 | } | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||