mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-04 02:54:12 +02:00
Add live cursor-coordinate readout to the element editor status bar (#580)
Displays the cursor's scene position (same grid units as the parts' X/Y property spinboxes) in a permanent status bar label, updated on every mouse move. Addresses the overlapping-node mis-click case from the originating forum report: with a live readout, precise pointing no longer requires guessing against nearby z-ordered points. ElementScene::mouseMoveEvent already computed the (optionally grid-snapped) scene position on every move; it now also emits it via a new mouseMoved(QPointF) signal, which QETElementEditor's status bar label subscribes to.
This commit is contained in:
@@ -124,6 +124,7 @@ void ElementScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
|
||||
{
|
||||
if (m_event_interface) {
|
||||
if (m_event_interface -> mouseMoveEvent(e)) {
|
||||
emit mouseMoved(e -> scenePos());
|
||||
if (m_event_interface->isFinish()) {
|
||||
delete m_event_interface;
|
||||
m_event_interface = nullptr;
|
||||
@@ -136,6 +137,8 @@ void ElementScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
|
||||
if (!(e -> modifiers() & Qt::ControlModifier))
|
||||
event_pos = snapToGrid(event_pos);
|
||||
|
||||
emit mouseMoved(event_pos);
|
||||
|
||||
if (m_behavior == PasteArea) {
|
||||
QRectF current_rect(m_paste_area -> rect());
|
||||
current_rect.moveCenter(event_pos);
|
||||
|
||||
Reference in New Issue
Block a user