Add widgets test
This commit is contained in:
parent
a2fba6034b
commit
a72b832a99
2 changed files with 66 additions and 0 deletions
|
|
@ -17,3 +17,4 @@ classifiers = [
|
|||
|
||||
[project.scripts]
|
||||
leek = "leek.leek:main"
|
||||
widgets = "leek.widgets:main"
|
||||
|
|
|
|||
65
src/leek/widgets.py
Normal file
65
src/leek/widgets.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue