dashboard/datasets: use scientific spinbox and increase number of decimals, closes #572

This commit is contained in:
Sebastien Bourdeauducq 2016-10-17 19:57:59 +08:00
parent 85834976d9
commit 02adccf4a2
1 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@ from PyQt5 import QtCore, QtWidgets
from artiq.tools import short_format
from artiq.gui.tools import LayoutWidget, QRecursiveFilterProxyModel
from artiq.gui.models import DictSyncTreeSepModel
from artiq.gui.scientific_spinbox import ScientificSpinBox
logger = logging.getLogger(__name__)
@ -50,10 +51,10 @@ class Editor(QtWidgets.QDialog):
class NumberEditor(Editor):
def get_edit_widget(self, initial_value):
self.edit_widget = QtWidgets.QDoubleSpinBox()
self.edit_widget.setMinimum(float("-inf"))
self.edit_widget.setMaximum(float("+inf"))
self.edit_widget.setDecimals(8)
self.edit_widget = ScientificSpinBox()
self.edit_widget.setDecimals(13)
self.edit_widget.setPrecision()
self.edit_widget.setRelativeStep()
self.edit_widget.setValue(float(initial_value))
return self.edit_widget