main
parent 3a0282af59
commit ea15b96a97

@ -150,45 +150,53 @@ class VarButtonDelegate(QItemDelegate):
self.parent() self.parent()
) )
readORwirte = self.parent().model.datas[index.row()][4] boxLayout = QHBoxLayout()
if 'w' not in readORwirte:
return
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( refreshButton = QPushButton(
qtawesome.icon('mdi6.refresh', color='#1fbb6f'), qtawesome.icon('fa.refresh', color='#1fbb6f'),
"", "",
self.parent() self.parent()
) )
refreshButton.setToolTip('刷新') refreshButton.setToolTip('刷新')
refreshButton.setObjectName("refreshButton")
refreshButton.clicked.connect(self.refreshData) refreshButton.clicked.connect(self.refreshData)
refreshButton.index = [index.row(), index.column()] refreshButton.index = [index.row(), index.column()]
boxLayout = QHBoxLayout() readORwirte = self.parent().model.datas[index.row()][4]
if objectType == 'TARGET_MODE': if 'w' not in readORwirte:
combox = QComboBox() boxLayout.addWidget(QSplitter())
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) boxLayout.addWidget(refreshButton)
boxLayout.addWidget(QSplitter())
else:
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('强制')
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') startActionBtn.setObjectName('startActionBtn')
boxLayout.setContentsMargins(0, 0, 0, 0) boxLayout.setContentsMargins(0, 0, 0, 0)
widget = QWidget() widget = QWidget()
@ -248,6 +256,8 @@ class VarButtonDelegate(QItemDelegate):
# self.loadingDataWidget = LoadingDataWidget() # self.loadingDataWidget = LoadingDataWidget()
# self.loadingDataWidget.show() # self.loadingDataWidget.show()
# self.loadingDataWidget.loadData(1, 1) # self.loadingDataWidget.loadData(1, 1)
self.loadingDataWidget = LoadingDataWidget(refreshType = True)
self.loadingDataWidget.exec_()
model.updateColumn(sender.index[0], value) model.updateColumn(sender.index[0], value)
# self.parent().resizeHeader() # self.parent().resizeHeader()
blockView.proxy.invalidate() blockView.proxy.invalidate()

Loading…
Cancel
Save