arrows: clean all arrows when changing phase; arrow color dependent on modifier keys; remove a single arrow by rightclicking

This commit is contained in:
Max-Wilhelm Bruker 2009-10-21 11:02:02 +02:00
parent c57e138a78
commit 897dca2386
8 changed files with 58 additions and 11 deletions

View file

@ -204,7 +204,16 @@ void CardItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (event->buttons().testFlag(Qt::RightButton)) {
if ((event->screenPos() - event->buttonDownScreenPos(Qt::RightButton)).manhattanLength() < 2 * QApplication::startDragDistance())
return;
ArrowDragItem *arrow = new ArrowDragItem(this);
QColor arrowColor = Qt::red;
if (event->modifiers().testFlag(Qt::ControlModifier))
arrowColor = Qt::yellow;
else if (event->modifiers().testFlag(Qt::AltModifier))
arrowColor = Qt::blue;
else if (event->modifiers().testFlag(Qt::ShiftModifier))
arrowColor = Qt::green;
ArrowDragItem *arrow = new ArrowDragItem(this, arrowColor);
scene()->addItem(arrow);
arrow->grabMouse();
} else {