Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1.         self.TWrootLocation         = self.findChild(QLineEdit, "leTWroot")
  2.         self.btnTWrootLocation      = self.findChild(QPushButton, "pbTwLocal")
  3.         self.SOPlocation            = self.findChild(QLineEdit, "leSOPLocation")
  4.         self.btnSOPocation          = self.findChild(QPushButton, "pbSOPLocation")
  5.         self.DeliveryLocation       = self.findChild(QLineEdit, "leDeliveryLocation")
  6.         self.btnDeliveryLocation    = self.findChild(QPushButton, "pbDeliveryLocal")
  7.  
  8.  
  9.  
  10.  
  11.         self.btnTWrootLocation.clicked.connect(lambda state, x=0: self.GeTPath(x))
  12.         self.btnSOPocation.clicked.connect(lambda state, x=1: self.GeTPath(x))
  13.         self.btnDeliveryLocation.clicked.connect(lambda state, x=2: self.GeTPath(x))
  14.  
  15.  
  16.     def GeTPath(self, id):
  17.         dialog = QFileDialog()
  18.         folderPath = dialog.getExistingDirectory(None, "Select Folder")
  19.         if id == 0:
  20.             # Setting text
  21.             self.TWrootLocation.setText(folderPath)
  22.  
  23.         elif id == 1:
  24.             # setting the text
  25.             self.SOPlocation.setText(folderPath)
  26.  
  27.         elif id == 2:
  28.             # Setting text
  29.             self.DeliveryLocation.setText(folderPath)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement