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):
|
def __init__(self, argument):
|
||||||
QtGui.QLineEdit.__init__(self)
|
QtGui.QLineEdit.__init__(self)
|
||||||
self.setText(argument["state"])
|
self.setText(argument["state"])
|
||||||
def update():
|
def update(text):
|
||||||
argument["state"] = self.text()
|
argument["state"] = text()
|
||||||
self.editingFinished.connect(update)
|
self.textEdited.connect(update)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def state_to_value(state):
|
def state_to_value(state):
|
||||||
|
@ -220,9 +220,9 @@ class _ExperimentDock(dockarea.Dock):
|
||||||
self.addWidget(pipeline_name, 1, 3)
|
self.addWidget(pipeline_name, 1, 3)
|
||||||
|
|
||||||
pipeline_name.setText(scheduling["pipeline_name"])
|
pipeline_name.setText(scheduling["pipeline_name"])
|
||||||
def update_pipeline_name():
|
def update_pipeline_name(text):
|
||||||
scheduling["pipeline_name"] = pipeline_name.text()
|
scheduling["pipeline_name"] = text
|
||||||
pipeline_name.editingFinished.connect(update_pipeline_name)
|
pipeline_name.textEdited.connect(update_pipeline_name)
|
||||||
|
|
||||||
priority = QtGui.QSpinBox()
|
priority = QtGui.QSpinBox()
|
||||||
priority.setRange(-99, 99)
|
priority.setRange(-99, 99)
|
||||||
|
|
|
@ -104,9 +104,9 @@ class _Explicit(LayoutWidget):
|
||||||
self.value))
|
self.value))
|
||||||
|
|
||||||
self.value.setText(" ".join([str(x) for x in state["sequence"]]))
|
self.value.setText(" ".join([str(x) for x in state["sequence"]]))
|
||||||
def update():
|
def update(text):
|
||||||
state["sequence"] = [float(x) for x in self.value.text().split()]
|
state["sequence"] = [float(x) for x in text.split()]
|
||||||
self.value.editingFinished.connect(update)
|
self.value.textEdited.connect(update)
|
||||||
|
|
||||||
|
|
||||||
class ScanController(LayoutWidget):
|
class ScanController(LayoutWidget):
|
||||||
|
|
Loading…
Reference in New Issue