From ea15b96a97d3151281cb6f1429506a68b794b2ab Mon Sep 17 00:00:00 2001 From: "ADMINISTRATOR\\Administrator" <951937200@qq.com> Date: Thu, 20 Jun 2024 13:57:45 +0800 Subject: [PATCH] 0620 --- UI/BlockParameterModel.py | 64 ++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/UI/BlockParameterModel.py b/UI/BlockParameterModel.py index 121f313..6927b54 100644 --- a/UI/BlockParameterModel.py +++ b/UI/BlockParameterModel.py @@ -150,45 +150,53 @@ class VarButtonDelegate(QItemDelegate): self.parent() ) - readORwirte = self.parent().model.datas[index.row()][4] - if 'w' not in readORwirte: - return + boxLayout = QHBoxLayout() - dataType = self.parent().model.datas[index.row()][3] - objectType = self.parent().model.datas[index.row()][1] - - editlineLayout = ObjectTypeEditlayout(objectType, dataType) - - startActionBtn.index = [index.row(), index.column()] - startActionBtn.setToolTip('强制') - refreshButton = QPushButton( - qtawesome.icon('mdi6.refresh', color='#1fbb6f'), + qtawesome.icon('fa.refresh', color='#1fbb6f'), "", self.parent() ) refreshButton.setToolTip('刷新') + refreshButton.setObjectName("refreshButton") refreshButton.clicked.connect(self.refreshData) refreshButton.index = [index.row(), index.column()] - boxLayout = QHBoxLayout() - if objectType == 'TARGET_MODE': - combox = QComboBox() - combox.addItems(["非服务", "手动初始化", "本地超驰", '手动', '自动', '级联', '远程级联', '远程输出']) - combox.setCurrentIndex(-1) - combox.currentIndexChanged.connect(lambda index : self.startAction(modelIndex = index)) - boxLayout.addWidget(combox, 10) - boxLayout.addWidget(refreshButton,1) - - else: - boxLayout.addLayout(editlineLayout) - startActionBtn.clicked.connect(lambda: self.startAction(objectTypeEditlayout = editlineLayout)) - boxLayout.addWidget(startActionBtn) + readORwirte = self.parent().model.datas[index.row()][4] + if 'w' not in readORwirte: + boxLayout.addWidget(QSplitter()) boxLayout.addWidget(refreshButton) + boxLayout.addWidget(QSplitter()) + else: + dataType = self.parent().model.datas[index.row()][3] + objectType = self.parent().model.datas[index.row()][1] - - startActionBtn.setObjectName('startActionBtn') + editlineLayout = ObjectTypeEditlayout(objectType, dataType) + + startActionBtn.index = [index.row(), index.column()] + startActionBtn.setToolTip('强制') + + + + + if objectType == 'TARGET_MODE': + combox = QComboBox() + combox.setObjectName('modeCombox') + combox.addItems(["非服务", "手动初始化", "本地超驰", '手动', '自动', '级联', '远程级联', '远程输出']) + combox.setCurrentIndex(-1) + combox.currentIndexChanged.connect(lambda index : self.startAction(modelIndex = index)) + boxLayout.addWidget(combox, 10) + boxLayout.addWidget(refreshButton,1) + + else: + boxLayout.addLayout(editlineLayout) + startActionBtn.clicked.connect(lambda: self.startAction(objectTypeEditlayout = editlineLayout)) + boxLayout.addWidget(startActionBtn) + boxLayout.addWidget(refreshButton) + + + startActionBtn.setObjectName('startActionBtn') boxLayout.setContentsMargins(0, 0, 0, 0) widget = QWidget() @@ -248,6 +256,8 @@ class VarButtonDelegate(QItemDelegate): # self.loadingDataWidget = LoadingDataWidget() # self.loadingDataWidget.show() # self.loadingDataWidget.loadData(1, 1) + self.loadingDataWidget = LoadingDataWidget(refreshType = True) + self.loadingDataWidget.exec_() model.updateColumn(sender.index[0], value) # self.parent().resizeHeader() blockView.proxy.invalidate()