mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 13:24:14 +02:00
8ee3f90047
Two issues on the interactive paste path: 1. Stall: DiagramEventAddPaste's constructor called Diagram::fromXml() with no database batching, so every addItem() emitted dataBaseUpdated() and each connected table model re-ran its full SQL query. A typical paste (~40 elements + ~40 conductors) triggered ~77 rebuilds of the table models -- measured at ~2.1 s of pure fromXml time on a large project. Project loading already batches this via setUpdateBlocked()/blockSignals() (QETProject::readProjectXml); the paste path now does the same: block during fromXml, one updateDB() after. Measured fromXml: 2114 ms -> 143 ms. 2. Cursor jump: m_initial_cursor was set to the group origin but the physical cursor stayed at the Ctrl+V press location, so the first mouseMoveEvent computed a large delta and the items jumped on first touch. Warp the cursor to the group origin after placement so the baseline and the actual cursor position match.