mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-20 15:24:14 +02:00
Fix stale geometry in LineEditor on multi-select
LineEditor::setPart() no-ops (skipping updateForm()) when the part passed in is already m_part. That is harmless when the editor widget is torn down between selections, but this branch keeps the same editor instance installed across selection changes instead of recreating it, so a line already shown alone can also be parts.first() of a later multi-selection -- and the x1/y1/x2/y2 spinboxes then keep showing whatever was in them before, not this selection's actual first line. setParts() now always calls updateForm() after setPart() succeeds, closing the gap regardless of the identity check inside setPart(). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -156,6 +156,16 @@ bool LineEditor::setParts(QList<CustomElementPart *> parts)
|
||||
return false;
|
||||
}
|
||||
|
||||
// setPart() no-ops when parts.first() is already m_part (its own
|
||||
// identity guard), which skips updateForm(). That is fine when this
|
||||
// editor widget stayed on screen the whole time, but since PR #675
|
||||
// keeps the same editor instance installed across selection changes
|
||||
// instead of tearing it down, an already-shown single line can also be
|
||||
// parts.first() of a later multi-selection -- and without this call
|
||||
// the geometry spinboxes keep showing whatever was in them before,
|
||||
// not this selection's actual first line.
|
||||
updateForm();
|
||||
|
||||
return m_style->setParts(parts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user