diff --git a/UI/VarManages/ModbusModel.py b/UI/VarManages/ModbusModel.py index 3fb4601..d1cfd60 100644 --- a/UI/VarManages/ModbusModel.py +++ b/UI/VarManages/ModbusModel.py @@ -58,7 +58,7 @@ class VarTableModel(QAbstractTableModel): def initTable(self): self.datas = [] - + self.editableList = [] self.table.parent.initIcon() proType = Globals.getValue('currentProType') @@ -450,11 +450,15 @@ class ModbusTypeBox(QItemDelegate): super(ModbusTypeBox, self).__init__(parent) def paint(self, painter, option, index): - if index.column() == 5: + if index.column() == 5 and index.row() not in self.parent().model.editableList: data = self.parent().model.datas[index.row()] comBox = str('cb' + str(index.row()) + str(index.column())) + # try: + # comboBox = getattr(self, comBox) + # except: setattr(self, comBox, QComboBox()) comboBox = getattr(self, comBox) + # comboBox = getattr(self, comBox) item = ['Coil Status', 'Input Status', 'Input Register', 'Holding Register'] comboBox.addItems(item)