From cc22dc666a5200c94f003cf823d256ad95c80eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Fri, 10 Mar 2023 08:56:33 -0300 Subject: [PATCH] =?UTF-8?q?Usando=20um=20arquivo=20UI=20do=20Qt=20Designer?= =?UTF-8?q?=20com=20seu=20c=C3=B3digo=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula203-qtdesigner/src/main_window.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 aula203-qtdesigner/src/main_window.py diff --git a/aula203-qtdesigner/src/main_window.py b/aula203-qtdesigner/src/main_window.py new file mode 100644 index 0000000..a9386df --- /dev/null +++ b/aula203-qtdesigner/src/main_window.py @@ -0,0 +1,23 @@ +import sys + +from PySide6.QtWidgets import QApplication, QMainWindow +from window import Ui_MainWindow + + +class MainWindow(QMainWindow, Ui_MainWindow): + def __init__(self, parent=None): + super().__init__(parent) + self.setupUi(self) + + self.buttonSend.clicked.connect(self.changeLabelResult) # type: ignore + + def changeLabelResult(self): + text = self.lineName.text() + self.labelResult.setText(text) + + +if __name__ == '__main__': + app = QApplication(sys.argv) + mainWindow = MainWindow() + mainWindow.show() + app.exec()