[PyQt] accessing variables of class

Enes Albay albayenes at gmail.com
Fri May 11 14:12:18 BST 2012


On 05/11/2012 12:15 AM, Wolfgang Rohdewald wrote:
>  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
>

Thanks for reply. But, unfortunately, it doesn't solve my problem. My
problem is how propagate click signal from own pushbutton class to own
mainwindow. So i can change value of mainwindow member. For this example
this member lineEdit.

When i press the my button class object button, i want to change
lineEdit, which is in mainwindow class, value.



More information about the PyQt mailing list