Formulator / qt /components /recipes.py
AngoHF's picture
04.12 commit
88de31c
raw
history blame
731 Bytes
from qt.components import ListWithLabel
from PySide6.QtWidgets import QWidget, QGridLayout
from qt.constant import MAX_RECIPE_SKILLS
class RecipesWidget(QWidget):
def __init__(self):
super().__init__()
layout = QGridLayout()
self.setLayout(layout)
self.recipes = []
columns = 6
rows = MAX_RECIPE_SKILLS // columns
for i in range(rows):
for j in range(columns):
recipe = ListWithLabel("")
self.recipes.append(recipe)
layout.addWidget(recipe, i, j)
def __getitem__(self, item) -> ListWithLabel:
return self.recipes[item]
def values(self) -> list[ListWithLabel]:
return self.recipes