Spaces:
Runtime error
Runtime error
File size: 731 Bytes
2452398 88de31c 2452398 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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
|