From 2aff31b61e6f9ad8fe45d181d3839bf7313c038d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czcw=E2=80=9D?= Date: Thu, 26 Oct 2023 19:15:02 +0800 Subject: [PATCH] =?UTF-8?q?1026b=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI/VarManages/ModbusModel.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)