mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-03 18:44:13 +02:00
80fcd4283d
Implements the third pillar of #574: a lightweight quick-open popup for jumping straight to an element on the current diagram, rather than scrolling/scanning visually. New JumpToElementDialog (sources/ui/): a small QDialog with a filter QLineEdit and a live-filtered QListWidget beneath it. Built from every Element on the diagram, searchable against its label (elementInformations().value("label")), type name (Element::name()), and every other element information value, joined into one lowercased search string per candidate. Up/Down move through the filtered list, Enter selects the highlighted element on the diagram (clearing the rest of the selection) and scrolls it into view via ensureVisible(), Escape cancels without changing the current selection. All three are handled via an event filter on the line edit, so the user never has to leave the text field to navigate or confirm. Triggered by a new Ctrl+G action in QETDiagramEditor, added next to the existing Ctrl+F "search and replace" action and to the Edit menu. Confirmed free: not used anywhere in qetdiagrameditor.cpp or qetmainwindow.cpp today. Explicitly not a duplicate of the existing SearchAndReplace module (also on this menu, via Ctrl+F): that's a bulk property search/replace tool across whole diagrams; this is a single-item navigational popup with no editing capability. Verified end-to-end in a real running session (Xvfb + xdotool) against a multi-transistor schematic: Ctrl+G opens the popup listing every element; typing "Q16" live-filters down to the one match; arrow keys move the highlighted row through the filtered list; Enter selects the highlighted element (confirmed via the properties panel showing its label) and closes the popup; Escape closes it without changing the selection. See discussion #574. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>