Zoe Forbes 6f4ac5ffb1 fix(datum): prevent RuntimeError from deleted Qt widgets in params UI
QFormLayout.removeRow() destroys the widgets it owns, transferring
ownership to Qt which immediately deletes the underlying C++ objects.
The update_params_ui() method was calling removeRow(0) in a loop to
clear the parameter fields before re-populating them for the new mode.
This destroyed the long-lived QDoubleSpinBox instances (offset_spin,
angle_spin, param_spin, x/y/z_spin) stored as instance attributes.

On the next call to update_params_ui() — triggered by selection
changes, row removal, or mode override — the method attempted to
addRow() with these same Python references, but the C++ objects behind
them had already been freed by Qt. This produced:

  RuntimeError: Internal C++ object (PySide6.QtWidgets.QDoubleSpinBox)
  already deleted.

The fix replaces the removeRow() loop with a new _clear_params_layout()
method that uses QLayout.takeAt() to detach items from the layout
without destroying them. Each widget is hidden and reparented to None
(releasing Qt's ownership) so it survives the layout clearing and can
be safely re-added with addRow() and show() on the next mode switch.
2026-01-31 20:39:20 -06:00
2026-01-24 15:16:09 -06:00
2026-01-24 15:16:09 -06:00
2026-01-24 15:16:09 -06:00
2026-01-26 06:34:59 -06:00
2026-01-26 06:34:59 -06:00
2026-01-24 15:16:09 -06:00
Description
No description provided
467 KiB
Languages
Python 98.6%
Makefile 1.4%