def __init__(self, unitGroup, field_type=int):
super(UnitLineEdit, self).__init__()
self.unit_idx = 0
self._value = 0
self._field_type = float
self.layout = QtGui.QHBoxLayout()
self.layout.setContentsMargins(0,0,0,0)
self.__lineEdit = PLineEdit()
self.__lineEdit.editingFinished.connect(self.text_changed)
self.__unitDropDown = QtGui.QComboBox()
self.__unitDropDown.currentIndexChanged.connect(self.indexChanged)
self._placeholder_value = None
self.setLayout(self.layout)
self.layout.addWidget(self.__lineEdit, 0)
self.layout.addWidget(self.__unitDropDown, 1)
self.setUnitGroup(unitGroup)
评论列表
文章目录