mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-22 22:34:13 +02:00
Repeat the last drawing or placing command with Enter
Enter on a folio runs the last drawing or placing command again, as it does in SolidWorks: the last tool from the add-item family (text, line, rectangle, terminal strip plan...) or the last element placed, however it was placed -- dragged, double-clicked, picked, or from the shortcut bar. Enter is handled in DiagramView::keyPressEvent, not bound as a shortcut, so it keeps working everywhere else: search fields, the collection tree, dialogs. On the folio it is left alone while a tool is running or an item has the focus (a text being edited), and with any modifier held. The same command is in Édition, named after what it will do -- "Répéter : Ajouter une ligne", "Répéter : insérer « Diode »" -- and registered with ShortcutManager (diagrameditor.repeat_last_command, no default key), so it can be bound or put on the shortcut bar. Discussion #1033. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2d2Zi8BfrYRPX88zhaoFG (cherry picked from commit 1e06ce97961ee18734ddaaa9b72b0303a169b9b2)
This commit is contained in:
@@ -963,6 +963,18 @@ void DiagramView::keyPressEvent(QKeyEvent *e)
|
||||
focusNextChild();
|
||||
}
|
||||
return;
|
||||
case Qt::Key_Return:
|
||||
case Qt::Key_Enter:
|
||||
//Repeat the last drawing or placing command, as SolidWorks
|
||||
//does. Not while a tool is running or a text has the focus:
|
||||
//both use Enter themselves.
|
||||
if (e->modifiers() == Qt::NoModifier
|
||||
&& !m_diagram->eventInterfaceIsRunning()
|
||||
&& !m_diagram->focusItem()
|
||||
&& diagramEditor()->repeatLastCommand()) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case Qt::Key_PageUp:
|
||||
current_project->changeTabUp();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user