Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. class TestUI(QtGui.QDialog):
  2.     super(TestUI, self).__init__(parent)
  3.     # ... dialog setup ...
  4.     self.okBtn = QtGui.QPushButton('ok')
  5.     self.cancelBtn = QtGui.QPushButton('cancel')
  6.    
  7.     self.okButton.clicked.connect(self.okButtonCallback)
  8.     self.cancelBtn.clicked.connect(self.cancelBtnCallback)
  9.    
  10.     def okButonCallback(self):
  11.         self.close()
  12.         return True # Can I return a variable from here???
  13.    
  14.     def canccelButtonCallback(self):
  15.         self.close()
  16.         return False
  17.  
  18. foo = TestUI()
  19. foo.show()
  20. print foo # ???? is there a way to get the return value????
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement