add Btype

This commit is contained in:
2024-12-10 11:44:34 +01:00
parent 959810c9e3
commit d25d4861f9
6 changed files with 45 additions and 6 deletions

19
lib/DB/BTypeModel.py Normal file
View File

@@ -0,0 +1,19 @@
from PySide6.QtCore import QAbstractListModel, Qt, QModelIndex
from .BTypeDAO import BTypeDAO
class BTypeModel(QAbstractListModel):
def __init__(self):
super().__init__()
self.__btype_data = BTypeDAO().getBType()
def rowCount(self, parent = QModelIndex()):
return len(self.__btype_data)
def data(self, index, role = Qt.DisplayRole):
row = index.row()
if role == Qt.DisplayRole:
data= self.__btype_data[row][1]
return data
return None