Example #1
0
 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)
Example #2
0
 def __init__(self,
     name: str,
     widget: QLineEdit
 ):
     QUndoCommand.__init__(self)
     self.name = name
     self.widget = widget
Example #3
0
 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)
Example #4
0
 def __init__(self,
     row: int,
     table: QTableWidget,
     isRename: bool
 ):
     QUndoCommand.__init__(self)
     self.table = table
     self.row = row
     self.isRename = isRename
Example #5
0
 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
Example #6
0
 def __init__(self,
     name: str,
     widget: QListWidget,
     mechanism: str
 ):
     QUndoCommand.__init__(self)
     self.name = name
     self.widget = widget
     self.mechanism = mechanism
Example #7
0
 def __init__(self,
     row: int,
     widget: QListWidget,
     data: Tuple[Tuple[float, float]]
 ):
     QUndoCommand.__init__(self)
     self.row = row
     self.widget = widget
     self.data = data
Example #8
0
 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
Example #9
0
 def __init__(self, table, row, q):
     QUndoCommand.__init__(self)
     self.table = table
     self.row = row
     self.q = q
Example #10
0
 def __init__(self, table: QTableWidget):
     QUndoCommand.__init__(self)
     self.table = table
Example #11
0
 def __init__(self, row: int, widget: QListWidget):
     QUndoCommand.__init__(self)
     self.item = widget.item(row)
     self.widget = widget
Example #12
0
 def __init__(self, text: str, widget: QListWidget):
     QUndoCommand.__init__(self)
     self.item = QListWidgetItem(text)
     self.widget = widget
Example #13
0
 def __init__(self, widget: QLineEdit):
     QUndoCommand.__init__(self)
     self.name = widget.text()
     if not self.name:
         self.name = widget.placeholderText()
     self.widget = widget