import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QLineEdit class MainWindow(QMainWindow): def __init__(self): super().__init__() button1 = QPushButton(self) button1.setText("Mehet") button1.move(50, 100) button1.clicked.connect(self.on_click_button1) self.entry1 = QLineEdit(self) self.entry1.move(50, 60) self.setGeometry(100,100,320,200) self.setWindowTitle("Helló Világ") self.show() def on_click_button1(self): text1 = self.entry1.text() self.setWindowTitle(text1) if __name__ == '__main__': app = QApplication(sys.argv) mainWindow = MainWindow() sys.exit(app.exec_())