def __init__(self, row: int, LinkTable: QTableWidgetItem, PointTable: QTableWidgetItem, Args: Sequence[table_data] ): QUndoCommand.__init__(self) self.LinkTable = LinkTable self.row = row self.PointTable = PointTable ''' name: str, color: str, points: str ''' self.Args = tuple(Args) self.OldArgs = self.LinkTable.rowTexts(row) #Points: Tuple[int] newPoints = self.Args[2].split(',') oldPoints = self.OldArgs[2].split(',') newPoints = set( int(index.replace('Point', '')) for index in noNoneString(newPoints) ) oldPoints = set( int(index.replace('Point', '')) for index in noNoneString(oldPoints) ) self.NewPointItems = tuple(newPoints - oldPoints) self.OldPointItems = tuple(oldPoints - newPoints)
def __init__(self, name: str, widget: QLineEdit ): QUndoCommand.__init__(self) self.name = name self.widget = widget
def __init__(self, row: int, PointTable: QTableWidgetItem, LinkTable: QTableWidgetItem, Args: Sequence[table_data] ): QUndoCommand.__init__(self) self.PointTable = PointTable self.row = row self.LinkTable = LinkTable ''' Links: str, Type: int, Color: str, X, Y ''' self.Args = tuple(Args) self.OldArgs = self.PointTable.rowTexts(row)[1:-1] #Tuple[str] -> Set[str] newLinks = set(self.Args[0].split(',')) oldLinks = set(self.OldArgs[0].split(',')) self.NewLinkItems = [] self.OldLinkItems = [] for row in range(self.LinkTable.rowCount()): linkName = self.LinkTable.item(row, 0).text() if linkName in newLinks - oldLinks: self.NewLinkItems.append(row) if linkName in oldLinks - newLinks: self.OldLinkItems.append(row) self.NewLinkItems = tuple(self.NewLinkItems) self.OldLinkItems = tuple(self.OldLinkItems)
def __init__(self, row: int, table: QTableWidget, isRename: bool ): QUndoCommand.__init__(self) self.table = table self.row = row self.isRename = isRename
def __init__(self, row: int, widget: QListWidget ): QUndoCommand.__init__(self) self.row = row self.widget = widget self.name = widget.item(row).text() self.mechanism = widget.item(row).expr
def __init__(self, name: str, widget: QListWidget, mechanism: str ): QUndoCommand.__init__(self) self.name = name self.widget = widget self.mechanism = mechanism
def __init__(self, row: int, widget: QListWidget, data: Tuple[Tuple[float, float]] ): QUndoCommand.__init__(self) self.row = row self.widget = widget self.data = data
def __init__(self, widget: QListWidget, name: str, data: Dict[str, Tuple[Tuple[float, float]]], path: Tuple[Tuple[float, float]] ): QUndoCommand.__init__(self) self.widget = widget self.name = name self.data = data self.path = path
def __init__(self, table, row, q): QUndoCommand.__init__(self) self.table = table self.row = row self.q = q
def __init__(self, table: QTableWidget): QUndoCommand.__init__(self) self.table = table
def __init__(self, row: int, widget: QListWidget): QUndoCommand.__init__(self) self.item = widget.item(row) self.widget = widget
def __init__(self, text: str, widget: QListWidget): QUndoCommand.__init__(self) self.item = QListWidgetItem(text) self.widget = widget
def __init__(self, widget: QLineEdit): QUndoCommand.__init__(self) self.name = widget.text() if not self.name: self.name = widget.placeholderText() self.widget = widget