Here's an example of how to use signals and slots:

self.initUI()

If you're looking for a PDF version of this tutorial, you can download it from the following link:

def main(): app = QApplication(sys.argv) ex = SignalsAndSlotsApp() sys.exit(app.exec())

button = QPushButton("Click me!") button.clicked.connect(self.on_button_clicked)