2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 19:28:26 +08:00

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 00402c9af9
commit 115204f2f4

View File

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