mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
DVEvent: press key escape, abort the curent action
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3369 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -609,6 +609,15 @@ void DiagramView::focusInEvent(QFocusEvent *e) {
|
||||
mode if needed.
|
||||
*/
|
||||
void DiagramView::keyPressEvent(QKeyEvent *e) {
|
||||
if (m_event_interface) {
|
||||
if (m_event_interface -> keyPressEvent(e)) {
|
||||
if (m_event_interface->isFinish()) {
|
||||
emit (itemAdded());
|
||||
delete m_event_interface; m_event_interface = nullptr;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
switchToVisualisationModeIfNeeded(e);
|
||||
QGraphicsView::keyPressEvent(e);
|
||||
}
|
||||
@@ -618,6 +627,15 @@ void DiagramView::keyPressEvent(QKeyEvent *e) {
|
||||
mode if needed.
|
||||
*/
|
||||
void DiagramView::keyReleaseEvent(QKeyEvent *e) {
|
||||
if (m_event_interface) {
|
||||
if (m_event_interface -> KeyReleaseEvent(e)) {
|
||||
if (m_event_interface->isFinish()) {
|
||||
emit (itemAdded());
|
||||
delete m_event_interface; m_event_interface = nullptr;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
switchToSelectionModeIfNeeded(e);
|
||||
QGraphicsView::keyReleaseEvent(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user