Hello,
I have simple class using PyQt5 library, it just a very beginner signal/slot example, where when a button is clicked there is label that should display "clicked"
I have simple class using PyQt5 library, it just a very beginner signal/slot example, where when a button is clicked there is label that should display "clicked"
class MyForm(QWidget): def __init__(self): super(MyForm, self).__init__() vbox = QVBoxLayout() label = QLabel("aos", self) button = QPushButton("Click") button.clicked.connect(self.clickeda) vbox.addWidget(label) vbox.addWidget(button) self.setLayout(vbox) self.show() def clickeda(self): self.label.setText("button clicked")and here is the error:
<class 'AttributeError'> 'MyForm' object has no attribute 'label' <traceback object at 0x03E3FC68>Can any one help