Skip to content

Commit

Permalink
Save the old annotation in case of key press event.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Dec 19, 2017
1 parent ce5afa2 commit 19775ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -2336,6 +2336,18 @@ void GraphicsView::focusOutEvent(QFocusEvent *event)

void GraphicsView::keyPressEvent(QKeyEvent *event)
{
// save annotations of all connections
foreach (LineAnnotation *pConnectionLineAnnotation, mConnectionsList) {
pConnectionLineAnnotation->setOldAnnotation(pConnectionLineAnnotation->getOMCShapeAnnotation());
}
// save annotations of all transitions
foreach (LineAnnotation *pTransitionLineAnnotation, mTransitionsList) {
pTransitionLineAnnotation->setOldAnnotation(pTransitionLineAnnotation->getOMCShapeAnnotation());
}
// save annotations of all initial states
foreach (LineAnnotation *pInitialStateLineAnnotation, mInitialStatesList) {
pInitialStateLineAnnotation->setOldAnnotation(pInitialStateLineAnnotation->getOMCShapeAnnotation());
}
bool shiftModifier = event->modifiers().testFlag(Qt::ShiftModifier);
bool controlModifier = event->modifiers().testFlag(Qt::ControlModifier);
if (event->key() == Qt::Key_Delete && isAnyItemSelectedAndEditable(event->key())) {
Expand Down

0 comments on commit 19775ba

Please sign in to comment.