Add widgets test

This commit is contained in:
Toast 2024-10-27 00:31:30 +02:00
parent a2fba6034b
commit a72b832a99
2 changed files with 66 additions and 0 deletions

View file

@ -17,3 +17,4 @@ classifiers = [
[project.scripts] [project.scripts]
leek = "leek.leek:main" leek = "leek.leek:main"
widgets = "leek.widgets:main"

65
src/leek/widgets.py Normal file
View file

@ -0,0 +1,65 @@
import sys
from PySide6.QtWidgets import (
QApplication,
QCheckBox,
QComboBox,
QDateEdit,
QDateTimeEdit,
QDial,
QDoubleSpinBox,
QFontComboBox,
QLabel,
QLCDNumber,
QLineEdit,
QMainWindow,
QProgressBar,
QPushButton,
QRadioButton,
QSlider,
QSpinBox,
QTimeEdit,
QVBoxLayout,
QWidget,
)
class WidgetsMainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("QT widgets test")
layout = QVBoxLayout()
widgets = [
QCheckBox,
QComboBox,
QDateEdit,
QDateTimeEdit,
QDial,
QDoubleSpinBox,
QFontComboBox,
QLCDNumber,
QLabel,
QLineEdit,
QProgressBar,
QPushButton,
QRadioButton,
QSlider,
QSpinBox,
QTimeEdit
]
for widget in widgets:
layout.addWidget(widget())
central_widget = QWidget()
central_widget.setLayout(layout)
self.setCentralWidget(central_widget)
def main() -> None:
app = QApplication(sys.argv)
window = WidgetsMainWindow()
window.show()
app.exec()