Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/erlab/interactive/_options/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ def _make_category_page(self, scope: _Scope, category: str) -> QtWidgets.QWidget

for path in paths:
control = self._make_control(path)
# The dialog saves and refreshes immediately after each value change.
# Defer typed numeric changes so a refresh does not interrupt entry.
if isinstance(control, QtWidgets.QAbstractSpinBox):
control.setKeyboardTracking(False)
for spin in control.findChildren(QtWidgets.QAbstractSpinBox):
spin.setKeyboardTracking(False)
row = _SettingsRow(scope=scope, path=path, control=control, parent=page)
self._rows[(scope, path)] = row
self._connect_control(row)
Expand Down
7 changes: 7 additions & 0 deletions tests/interactive/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ def test_dialog_native_structure(dialog: OptionDialog):
assert container.layout().contentsMargins().right() > 0


def test_dialog_spinboxes_disable_keyboard_tracking(dialog: OptionDialog):
spinboxes = dialog.findChildren(QtWidgets.QAbstractSpinBox)

assert spinboxes
assert all(not spin.keyboardTracking() for spin in spinboxes)


def test_dialog_setting_descriptions_are_visible_not_duplicate_tooltips(
dialog: OptionDialog,
):
Expand Down