robertvari

PySide6 test

Jun 13th, 2021 (edited)
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from PySide6.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QPushButton
  2. import sys
  3.  
  4.  
  5. class MyWindow(QWidget):
  6.     def __init__(self):
  7.         super(MyWindow, self).__init__()
  8.         self.setWindowTitle("Pyside 6 test")
  9.         self.resize(300, 100)
  10.  
  11.         main_layout = QVBoxLayout(self)
  12.         label = QLabel("Hello World")
  13.         main_layout.addWidget(label)
  14.  
  15.         button = QPushButton("Close")
  16.         button.clicked.connect(self.close)
  17.         main_layout.addWidget(button)
  18.  
  19.  
  20. if __name__ == '__main__':
  21.     app = QApplication(sys.argv)
  22.     win = MyWindow()
  23.     win.show()
  24.     app.exec()
Add Comment
Please, Sign In to add comment