Ejemplo n.º 1
0
 def deleteRow(self):
     print('Delete Row Clicked')
     indices = []
     for index in self.table.selectionModel().selectedRows():
         indices.append(QtCore.QPersistentModelIndex(index))
     for index in indices:
         self.table.removeRow(index.row())
Ejemplo n.º 2
0
 def addRow(self):
     print('Add Row Clicked')
     indices = []
     for index in self.table.selectionModel().selectedRows():
         indices.append(QtCore.QPersistentModelIndex(index))
     if len(indices) > 0:
         for index in indices:
             self.insertRow(index.row())
     else:
         self.insertRow(self.table.rowCount())