mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-21 22:04:13 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user