Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PyQt5 import QtWidgets, uic
- from PyQt5.QtWidgets import QApplication, QWidget
- import sys
- Form, Window = uic.loadUiType("1.ui")
- class App(QWidget):
- def __init__(self):
- self.ui = uic.loadUi("1.ui")
- self.start()
- def start(self):
- self.ui.show()
- self.set()
- def set(self):
- self.btn1.clicked.connect(self.button_clicked)
- def button_clicked(self):
- self.label.setText("you pressed the button")
- self.update()
- def update(self):
- self.label.adjustSize()
- def window():
- app = QApplication([])
- window = Window()
- form = Form()
- form.setupUi(window)
- window.show()
- sys.exit(app.exec_())
- window()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement