6f4ac5ffb1e277c0fb07dad8d24ac763ee5cd8b2
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.
Description
No description provided
Languages
Python
98.6%
Makefile
1.4%