Solved postcode Combobox
This commit is contained in:
@@ -89,19 +89,12 @@ ColumnLayout
|
|||||||
editable: true
|
editable: true
|
||||||
onCurrentTextChanged: isEmptyField()
|
onCurrentTextChanged: isEmptyField()
|
||||||
onEditTextChanged: isEmptyField()
|
onEditTextChanged: isEmptyField()
|
||||||
|
onActivated: currentValue
|
||||||
model: am
|
model: am
|
||||||
delegate: Text
|
textRole: "display"
|
||||||
{
|
popup.height: 300
|
||||||
text: model.display
|
popup.y: postcode.y + 5 - (postcode.height * 2)
|
||||||
elide: Text.ElideRight
|
currentIndex: -1
|
||||||
// width: parent.width
|
|
||||||
// height: parent.height
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
leftPadding: 9 //@d isable-check M16
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|||||||
@@ -8,23 +8,18 @@ class AddressModel(QAbstractListModel):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self.__address_data = AddressDAO().getAddressData()
|
self.__address_data = AddressDAO().getAddressData()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def rowCount(self, parent = QModelIndex()):
|
def rowCount(self, parent = QModelIndex()):
|
||||||
return 10
|
return len(self.__address_data)
|
||||||
|
|
||||||
|
|
||||||
def data(self, index, role = Qt.DisplayRole):
|
def data(self, index, role = Qt.DisplayRole):
|
||||||
row = index.row()
|
row = index.row()
|
||||||
|
|
||||||
if role == Qt.DisplayRole:
|
if role == Qt.DisplayRole:
|
||||||
|
|
||||||
data= self.__address_data[row][2]
|
data= self.__address_data[row][2]
|
||||||
|
|
||||||
print(type(data))
|
|
||||||
return data
|
return data
|
||||||
|
return None
|
||||||
|
|
||||||
|
def setData(self):
|
||||||
|
pass
|
||||||
|
|
||||||
@Slot(bool, str)
|
@Slot(bool, str)
|
||||||
def getAddresses(self, all, zipcode):
|
def getAddresses(self, all, zipcode):
|
||||||
|
|||||||
Reference in New Issue
Block a user