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.
18 lines
511 B
C++
18 lines
511 B
C++
#include "MyQGraphicsRectItem.h"
|
|
|
|
void MyQGraphicsRectItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|
{
|
|
if (event->button() == Qt::LeftButton && m_isNeedSelect) {
|
|
setBrush(CUR_SELECT_DIE);
|
|
}
|
|
|
|
m_isSelect = true;
|
|
emit signal_select(m_xCoord, m_yCoord);
|
|
}
|
|
|
|
//void MyQGraphicsRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget /*= nullptr*/)
|
|
//{
|
|
// QString str = QString::number(m_xCoord) + "," + QString::number(m_yCoord);
|
|
// painter->drawText(1, 1, str);
|
|
//}
|