Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PySide2.QtUiTools import QUiLoader
- from PySide2 import QtWidgets, QtGui, QtCore
- class MainForm(QtWidgets.QWidget):
- def _init_(self):
- super(MainForm, self)._init_()
- QUiLoader().load('ui/mainform.ui', self)
- self.btn_print.clicked.connect(self.print) #THROW ERROR
- self.show()
- self.secondForm = SecondForm()
- def print(self):
- print('asd')
- def closeEvent(self, event):
- sys.exit()
- class SecondForm(QtWidgets.QLabel):
- def _init_(self):
- super(SecondForm, self)._init_()
- self.show()
- if _name_ == '_main_':
- app = QtWidgets.QApplication()
- form = MainForm()
- form.show()
- sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment