Solved postcode Combobox

This commit is contained in:
2024-12-06 20:30:44 +01:00
parent f4bd9c296a
commit 82cbfb8daf
2 changed files with 9 additions and 21 deletions

View File

@@ -89,19 +89,12 @@ ColumnLayout
editable: true
onCurrentTextChanged: isEmptyField()
onEditTextChanged: isEmptyField()
onActivated: currentValue
model: am
delegate: Text
{
text: model.display
elide: Text.ElideRight
// width: parent.width
// height: parent.height
verticalAlignment: Text.AlignVCenter
leftPadding: 9 //@d isable-check M16
}
textRole: "display"
popup.height: 300
popup.y: postcode.y + 5 - (postcode.height * 2)
currentIndex: -1
}
Label

View File

@@ -8,23 +8,18 @@ class AddressModel(QAbstractListModel):
super().__init__()
self.__address_data = AddressDAO().getAddressData()
def rowCount(self, parent = QModelIndex()):
return 10
return len(self.__address_data)
def data(self, index, role = Qt.DisplayRole):
row = index.row()
if role == Qt.DisplayRole:
data= self.__address_data[row][2]
print(type(data))
return data
return None
def setData(self):
pass
@Slot(bool, str)
def getAddresses(self, all, zipcode):