From 0b1ec5206042b0edd0056ec1d6eb8ace87d882e5 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Sun, 15 Feb 2015 14:12:45 +0100 Subject: [PATCH] Simplified the ContactApp example --- Nim/Examples/ContactApp/ContactList.nim | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/Nim/Examples/ContactApp/ContactList.nim b/Nim/Examples/ContactApp/ContactList.nim index 0f07295..c1ccb7e 100644 --- a/Nim/Examples/ContactApp/ContactList.nim +++ b/Nim/Examples/ContactApp/ContactList.nim @@ -41,30 +41,6 @@ QtObject: of ContactRoles.Surname: return contact.surname else: return - method setData(self: ContactList, index: QModelIndex, value: QVariant, role: cint): bool = - result = false - if not index.isValid: - return - if index.row < 0 or index.row >= self.contacts.len: - return - if value.isNull: - return - var contact = self.contacts[index.row] - let contactRole = role.ContactRoles - case contactRole: - of ContactRoles.FirstName: - contact.firstName = value.stringVal - self.dataChanged(index, index, @[role]) - result = true - of ContactRoles.Surname: - contact.surname = value.stringVal - self.dataChanged(index, index, @[role]) - result = true - else: discard() - - method flags(self: ContactList): QtItemFlag = - return QtItemFlag.IsEditable - method roleNames(self: ContactList): Table[cint, cstring] = result = initTable[cint, cstring]() result[ContactRoles.FirstName] = "firstName"