28 lines
750 B
Python
28 lines
750 B
Python
import sys
|
|
from PySide6.QtWidgets import QApplication, QWidget, QLabel, QPushButton, QVBoxLayout
|
|
|
|
class TestWindow(QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setWindowTitle("PySide6 Test")
|
|
|
|
# Tworzymy label
|
|
self.label = QLabel("Hello from PySide6!", self)
|
|
|
|
# Tworzymy przycisk do zamykania
|
|
self.close_button = QPushButton("Zamknij")
|
|
self.close_button.clicked.connect(self.close)
|
|
|
|
# Układ pionowy
|
|
layout = QVBoxLayout()
|
|
layout.addWidget(self.label)
|
|
layout.addWidget(self.close_button)
|
|
|
|
self.setLayout(layout)
|
|
|
|
if __name__ == "__main__":
|
|
app = QApplication(sys.argv)
|
|
window = TestWindow()
|
|
window.show()
|
|
sys.exit(app.exec())
|