mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Handle mapping selection change on pressing mouse on a shape.
This commit is contained in:
+11
@@ -68,6 +68,17 @@ bool ShapeGraphicsItem::sceneEventFilter(QGraphicsItem * watched, QEvent * event
|
||||
}
|
||||
}
|
||||
|
||||
void ShapeGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||
{
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
|
||||
// Change mapping to currently selected shape.
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
MainWindow::instance()->setCurrentMapping(_mapping->getId());
|
||||
}
|
||||
}
|
||||
|
||||
void ShapeGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QGraphicsItem::mouseMoveEvent(event);
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
|
||||
virtual bool sceneEventFilter(QGraphicsItem * watched, QEvent * event);
|
||||
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
// virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user