diff --git a/Gui/AddCustomer.qml b/Gui/AddCustomer.qml index 93a2da9..5845615 100644 --- a/Gui/AddCustomer.qml +++ b/Gui/AddCustomer.qml @@ -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 diff --git a/lib/DB/AddressModel.py b/lib/DB/AddressModel.py index 6c7b1bb..bb8f870 100644 --- a/lib/DB/AddressModel.py +++ b/lib/DB/AddressModel.py @@ -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):