/
Spinogryz
/
Example-project
Обзор
Документация
Войти
/
Spinogryz
/
Example-project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test.py
37 строк
1 KB
Spinogryz
First_commit
15 фев 2025, 19:36
15 фев 2025, 19:36
e498578
Код
Авторство
О чём код?
# import sys # from PyQt5.QtWidgets import * # import sections # # app = QApplication(sys.argv) # create application # dlgMain = QDialog() # create main GUI window # dlgMain.setWindowTitle('First GUI') # dlgMain.show() # show the GUI # # sys.exit(app.exec_()) # execute the app import sys from PyQt5.QtWidgets import * # import sections class DlgMain(QDialog): def __init__(self): super().__init__() self.setWindowTitle('Second GUI') # add widgets and set properties self.resize(300, 200) self.ledtext = QLineEdit('Default text', self) self.ledtext.move(90, 50) self.btnUpdate = QPushButton('Update Window Title', self) self.btnUpdate.move(80, 80) self.btnUpdate.clicked.connect(self.evt_btn_update_clicked) def evt_btn_update_clicked(self): self.setWindowTitle(self.ledtext.text()) if __name__ == '__main__': app = QApplication(sys.argv) #create application dlgMain = DlgMain() # create main GUI window dlgMain.show() # show GUI sys.exit(app.exec_()) # execute the application