##// END OF EJS Templates
build fix.
build fix.

File last commit:

r737:e81beeb51921
r744:4a4cc4b22b41
Show More
bar.cpp
38 lines | 847 B | text/x-c | CppLexer
#include "bar_p.h"
#include <QDebug>
#include <QPainter>
#include <QGraphicsSceneEvent>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Bar::Bar(QString category, QGraphicsItem *parent)
: QGraphicsRectItem(parent),
mCategory(category)
{
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
setAcceptHoverEvents(true);
}
void Bar::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
emit clicked(mCategory);
} else if (event->button() == Qt::RightButton) {
emit rightClicked(mCategory);
}
}
void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
emit hoverEntered(event->lastScreenPos());
}
void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event)
emit hoverLeaved();
}
#include "moc_bar_p.cpp"
QTCOMMERCIALCHART_END_NAMESPACE