[PyQt] accessing variables of class

Wolfgang Rohdewald wolfgang at rohdewald.de
Thu May 10 22:15:18 BST 2012


Am Donnerstag, 10. Mai 2012, 22:41:06 schrieb Enes Albay:
> class C(QtGui.QPushButton):
> 
>      def __init__(self, parent, letter):
>          self.clicked.connect(self.handleLetter)
> 
>      def handleLetter(self):
>          ....
> 
> 
> I want to do that:
> 
>   lineEdit.setText("bla bla")    -------> this is in class A

class B(QtGui.QWidget):
     def setupUI(self):
	 self.c = C()
	 self.c.clicked.connect(self.c.handleLetter)

but I would probably move handleLetter to class B

-- 
Wolfgang


More information about the PyQt mailing list