SHARE
TWEET

Untitled

a guest Jan 17th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. from PySide2.QtUiTools import QUiLoader
  3. from PySide2 import QtWidgets, QtGui, QtCore
  4.  
  5.  
  6. class MainForm(QtWidgets.QWidget):
  7.  
  8.     def _init_(self):
  9.         super(MainForm, self)._init_()
  10.  
  11.         QUiLoader().load('ui/mainform.ui', self)
  12.  
  13.         self.btn_print.clicked.connect(self.print) #THROW ERROR
  14.  
  15.         self.show()
  16.         self.secondForm = SecondForm()
  17.  
  18.     def print(self):
  19.         print('asd')
  20.  
  21.     def closeEvent(self, event):
  22.         sys.exit()
  23.  
  24. class SecondForm(QtWidgets.QLabel):
  25.  
  26.     def _init_(self):
  27.         super(SecondForm, self)._init_()
  28.         self.show()
  29.  
  30. if _name_ == '_main_':
  31.     app = QtWidgets.QApplication()
  32.     form = MainForm()
  33.     form.show()
  34.     sys.exit(app.exec_())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top