You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
452 B
C++

#include "MyDieRectItem.h"
MyDieRectItem::MyDieRectItem(QObject *parent)
: QObject(parent)
{
}
MyDieRectItem::~MyDieRectItem()
{
}
void MyDieRectItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
m_startPos = event->pos();
}
}
void MyDieRectItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit signal_mouse(m_startPos, event->pos());
}
}