예제 #1
0
def checkbox_handler(item: QTableWidgetItem):
    try:
        account_thread = item.account_thread
    except:
        return
    if item.checkState() == 0:
        account_thread.deactivate()
    if item.checkState() == 2:
        account_thread.activate()
예제 #2
0
    def __onPlanetTableWidgetItemClicked(self, item: QTableWidgetItem) -> None:
        '''If a planet table widget item is clicked, check it and call the presenter to display it'''
        checked: bool = False
        if item.checkState() == QtCore.Qt.Checked:
            checked = True

        self.__presenter.onPlanetChecked(item.row(), checked)
예제 #3
0
파일: app.py 프로젝트: ChMcg/MBKS
 def handle_item_checked_new(self, item: QtWidgets.QTableWidgetItem):
     # self._validator.blockSignals(True)
     user, char = item.data(QtConstants.UserRole)
     checked = item.checkState() == QtConstants.Checked
     print((user, char), '->', checked)
     if checked:
         self._validator.add_symbol_for_user(user, char)
     else:
         self._validator.remove_symbol(user, char)
예제 #4
0
    def item_changed(self, item: QTableWidgetItem):
        """Update the planner to mark whether or not the assignment
        is completed
        """
        assignment_id = int(self.tablewidget_assignments.cellWidget(item.row(), 1).get_data())

        # If the checkbox is checked / Unchecked
        if item.column() == 0:
            self.app.planner.update_assignment(assignment_id, "completed", int(item.checkState() == 2))
            self.app.refresh()
예제 #5
0
 def _table_item_changed(self,item:QtWidgets.QTableWidgetItem):
     if item.column() == 0:
         circuit:Circuit = self.tableWidget.item(item.row(),1).data(Qt.UserRole)
         if item.checkState() == Qt.Checked:
             for node in circuit.nodes():
                 if node.train() is not None:
                     node.train().highlightItems(containLink=True)
         else:
             for node in circuit.nodes():
                 if node.train() is not None:
                     node.train().unHighlightItems(containLink=True)
예제 #6
0
 def _item_changed(self, item: QtWidgets.QTableWidgetItem):
     """
     2019.10.21添加
     """
     if item is None or item.column() != 4:
         return
     train = self.trainTable.item(item.row(), 0).data(-1)
     if train is None:
         return
     on = bool(item.checkState())
     train.setIsShow(on)
     self.trainShowChanged.emit(train, on)
예제 #7
0
 def _table_item_changed(self, item: QtWidgets.QTableWidgetItem):
     if self.updating:
         return
     # print("currentWidget::table_item_changed",item.text(),item.row(),item.column())
     row = item.row()
     if item.column() == 3:
         # 营业列变化
         itemStation = self.timeTable.item(row, 0)
         if item.checkState() == Qt.Checked:
             itemStation.setForeground(QtGui.QBrush(Qt.red))
         elif self.timeTable.cellWidget(
                 row, 1).time() != self.timeTable.cellWidget(row, 2).time():
             itemStation.setForeground(QtGui.QBrush(Qt.blue))
         else:
             itemStation.setForeground(QtGui.QBrush(Qt.black))