20 lines
523 B
Python
20 lines
523 B
Python
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
|
|
|