[PyQt] accessing variables of class

Enes Albay albayenes at gmail.com
Thu May 10 20:41:06 BST 2012


Hi,

I have problem about accessing member class variables.

For example;

I have 3 classes;

class A(QtGui.QMainWindow):
     ....
     def setupUI(self):
         self.lineEdit = QtGui.QLineEdit()
         self.b = B()
     ...

class B(QtGui.QWidget):
     ....
     def setupUI(self):
         self.C = C()
     ...

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

in handleLetter method in class C.

How can i do that?

Regards,



More information about the PyQt mailing list