diff --git a/pytec/pytec/gui/view/lockable_unit.py b/pytec/pytec/gui/view/lockable_unit.py index 78e519f..431c38f 100644 --- a/pytec/pytec/gui/view/lockable_unit.py +++ b/pytec/pytec/gui/view/lockable_unit.py @@ -1,3 +1,5 @@ +import re + from PyQt6.QtCore import QSignalBlocker from PyQt6.QtGui import QValidator @@ -7,6 +9,13 @@ from pyqtgraph.parametertree import registerParameterItemType from pyqtgraph.parametertree.parameterTypes import SimpleParameter, NumericParameterItem +# See https://github.com/pyqtgraph/pyqtgraph/issues/3115 +fn.FLOAT_REGEX = re.compile( + r"(?P[+-]?((((\d+(\.\d*)?)|(\d*\.\d+))([eE][+-]?\d+)?)|((?i:nan)|(inf))))\s*" + + r"((?P[u" + fn.SI_PREFIXES + r"]?)(?P.*))?$" +) + + class LockableUnitSpinBox(SpinBox): """ Extension of PyQtGraph's SpinBox widget.