forked from M-Labs/artiq
gui/experiments: fix text entry update problem with shortcuts
This commit is contained in:
parent
03f92f2de2
commit
9baf54d25e
@ -18,9 +18,9 @@ class _StringEntry(QtGui.QLineEdit):
|
||||
def __init__(self, argument):
|
||||
QtGui.QLineEdit.__init__(self)
|
||||
self.setText(argument["state"])
|
||||
def update():
|
||||
argument["state"] = self.text()
|
||||
self.editingFinished.connect(update)
|
||||
def update(text):
|
||||
argument["state"] = text()
|
||||
self.textEdited.connect(update)
|
||||
|
||||
@staticmethod
|
||||
def state_to_value(state):
|
||||
@ -220,9 +220,9 @@ class _ExperimentDock(dockarea.Dock):
|
||||
self.addWidget(pipeline_name, 1, 3)
|
||||
|
||||
pipeline_name.setText(scheduling["pipeline_name"])
|
||||
def update_pipeline_name():
|
||||
scheduling["pipeline_name"] = pipeline_name.text()
|
||||
pipeline_name.editingFinished.connect(update_pipeline_name)
|
||||
def update_pipeline_name(text):
|
||||
scheduling["pipeline_name"] = text
|
||||
pipeline_name.textEdited.connect(update_pipeline_name)
|
||||
|
||||
priority = QtGui.QSpinBox()
|
||||
priority.setRange(-99, 99)
|
||||
|
@ -104,9 +104,9 @@ class _Explicit(LayoutWidget):
|
||||
self.value))
|
||||
|
||||
self.value.setText(" ".join([str(x) for x in state["sequence"]]))
|
||||
def update():
|
||||
state["sequence"] = [float(x) for x in self.value.text().split()]
|
||||
self.value.editingFinished.connect(update)
|
||||
def update(text):
|
||||
state["sequence"] = [float(x) for x in text.split()]
|
||||
self.value.textEdited.connect(update)
|
||||
|
||||
|
||||
class ScanController(LayoutWidget):
|
||||
|
Loading…
Reference in New Issue
Block a user