Fixed first start configuration load and add city model in add customer

This commit is contained in:
2024-12-07 16:43:55 +01:00
parent 82cbfb8daf
commit 4dfe986111
5 changed files with 56 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
from PySide6.QtCore import QAbstractListModel, Qt, Slot, QModelIndex
from .AddressDAO import AddressDAO
from ..PyqcrmDataRoles import PyqcrmDataRoles
class AddressModel(QAbstractListModel):
@@ -16,8 +16,17 @@ class AddressModel(QAbstractListModel):
if role == Qt.DisplayRole:
data= self.__address_data[row][2]
return data
elif role == PyqcrmDataRoles.CITY_ROLE:
data= self.__address_data[row][3]
return data
return None
def roleNames(self):
return {
Qt.DisplayRole: b"display",
PyqcrmDataRoles.CITY_ROLE: b"city",
}
def setData(self):
pass