Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efe3341

Browse files
committed
Force Qt validator to use C locale.
Qt5's QDoubleValidator defaults to only accepting the default locale, making the axes properties editor unusable when the locale's decimal separator is not ".".
1 parent 3cd9c2d commit efe3341

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/matplotlib/backends/qt_editor/formlayout.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def setup(self):
298298
field = QtWidgets.QLineEdit(repr(value), self)
299299
field.setCursorPosition(0)
300300
field.setValidator(QtGui.QDoubleValidator(field))
301+
field.validator().setLocale(QtCore.QLocale("C"))
301302
dialog = self.get_dialog()
302303
dialog.register_float_field(field)
303304
field.textChanged.connect(lambda text: dialog.update_buttons())

0 commit comments

Comments
 (0)