Solved postcode Combobox
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user