class ObjectPathWIdget(InputWidgetSingle): """docstring for ObjectPathWIdget.""" def __init__(self, parent=None, **kwds): super(ObjectPathWIdget, self).__init__(parent=parent, **kwds) values = [] self.enumBox = EnumComboBox(PathsRegistry().getAllPaths()) self.setWidget(self.enumBox) self.enumBox.changeCallback.connect(self.dataSetCallback) def blockWidgetSignals(self, bLock=False): self.enumBox.blockSignals(bLock) def setWidgetValue(self, value): self.enumBox.setCurrentText(value)
class EnumInputWIdget(InputWidgetSingle): """docstring for EnumInputWIdget.""" def __init__(self, parent=None, **kwds): super(EnumInputWIdget, self).__init__(parent=parent, **kwds) self.enumBox = EnumComboBox(kwds["pinAnnotations"]["ValueList"]) self.enumBox.setEditable(False) self.setWidget(self.enumBox) self.enumBox.changeCallback.connect(self.dataSetCallback) def blockWidgetSignals(self, bLock=False): self.enumBox.blockSignals(bLock) def setWidgetValue(self, value): index = self.enumBox.findText(value) if index > 0: self.enumBox.setCurrentIndex(index)
class EnumInputWidget(InputWidgetSingle): """docstring for EnumInputWidget.""" def __init__(self, parent=None, **kwds): super(EnumInputWidget, self).__init__(parent=parent, **kwds) values = [] if PinSpecifires.VALUE_LIST in kwds["pinAnnotations"]: values = kwds["pinAnnotations"][PinSpecifires.VALUE_LIST] self.enumBox = EnumComboBox(values) self.enumBox.setEditable(False) if "editable" in kwds["pinAnnotations"]: self.enumBox.setEditable(kwds["pinAnnotations"]["editable"]) self.setWidget(self.enumBox) self.enumBox.changeCallback.connect(self.dataSetCallback) def blockWidgetSignals(self, bLock=False): self.enumBox.blockSignals(bLock) def setWidgetValue(self, value): index = self.enumBox.findText(value) if index > 0: self.enumBox.setCurrentIndex(index)