Handle mapping selection change on pressing mouse on a shape.

This commit is contained in:
Tats
2015-07-03 21:51:38 -06:00
parent 522ecac194
commit 67628915a3
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -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);
+1
View File
@@ -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);