def btnAdd_Click(self):
     if (len(self.trvLegs.selectedIndexes()) == 0 and not self.method_5()):
         return;
     listInsertPosition = ListInsertPosition.Append;
     resultDlg, listInsertPosition = DlgAixmInsertLeg.smethod_0(listInsertPosition)
     if (self.trvLegsStdModel.rowCount() > 0 and not resultDlg):
         return;
     count = self.trvLegsStdModel.rowCount()
     if (listInsertPosition == ListInsertPosition.Before):
         count = self.trvLegs.selectedIndexes()[0].row();
     elif (listInsertPosition == ListInsertPosition.After):
         count = self.trvLegs.selectedIndexes()[0].row() + 1;
     self.trvLegsStdModel.setItem(self.trvLegsStdModel.rowCount(), QStandardItem(str(self.trvLegsStdModel.rowCount() + 1)));
     self.legs.insert(count, DataBaseProcedureLeg());
     self.trvLegs.setCurrentIndex(self.trvLegsStdModel.index(count, 0))
     self.trvLegs_pressed()
Example #2
0
 def method_7(self):
     for i in range(self.legs.Count):
         num = i + 1
         self.trvLegsStdModel.setItem(i, QStandardItem(str(num)))
     self.method_6()