Skip to content

Commit c5a1f15

Browse files
committed
Also allow scientific notation in validator
1 parent 2e0285c commit c5a1f15

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

activity_browser/layouts/pages/activity_details/exchanges_tab.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ def createEditor(self, parent, option, index):
277277
editor = QtWidgets.QLineEdit(parent)
278278
locale = QtCore.QLocale(QtCore.QLocale.English)
279279
locale.setNumberOptions(QtCore.QLocale.RejectGroupSeparator)
280-
validator = QtGui.QRegularExpressionValidator(QtCore.QRegularExpression(r"^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)$"), editor)
280+
validator = QtGui.QRegularExpressionValidator(
281+
QtCore.QRegularExpression(r"^[+-]?((\d+(\.\d*)?)|(\.\d+))([eE][+-]?\d+)?$"),
282+
editor)
281283
validator.setLocale(locale)
282284
editor.setValidator(validator)
283285
return editor

0 commit comments

Comments
 (0)