Fix the following issues:

a) paste
- conductor does not move
- pressing escape does not abort
- pressing anything during the process crashes the program instead of aborting
b) similar issue with the escape not working fixed for graphics items, texxt fields (and probably others)
This commit is contained in:
Andre Rummler
2026-09-17 11:34:25 +02:00
parent ff3c2e0916
commit 923723a9de
6 changed files with 31 additions and 11 deletions
@@ -317,10 +317,16 @@ void DiagramEventAddShape::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
did anything. Re-running the last known mouse position through
applyPosition() here makes the key press or release itself the
trigger, giving immediate feedback instead of waiting on chance.
Any other key falls back to standard handling, e.g. pressing ESC aborts the operation.
*/
void DiagramEventAddShape::keyPressEvent(QKeyEvent *event)
{
reapplyLastPosition(event);
if (event->key() == Qt::Key_Shift || event->key() == Qt::Key_Control) {
reapplyLastPosition(event);
event->setAccepted(true);
} else {
DiagramEventInterface::keyPressEvent(event);
}
}
void DiagramEventAddShape::keyReleaseEvent(QKeyEvent *event)