1
0

QAbstractItemModel: fix sorting, QAbstractItemDelegate usage, QVariant usage

This commit is contained in:
Janus
2018-12-06 20:22:38 +01:00
committed by SomberNight
parent 4eb4b341db
commit 3960070a50
5 changed files with 44 additions and 57 deletions

View File

@@ -49,12 +49,8 @@ class ContactList(MyTreeView):
def on_edited(self, idx, user_role, text):
_type, prior_name = self.parent.contacts.pop(user_role)
# TODO when min Qt >= 5.11, use siblingAtColumn
col_1_sibling = idx.sibling(idx.row(), 1)
col_1_item = self.model().itemFromIndex(col_1_sibling)
self.parent.set_contact(text, col_1_item.text())
self.parent.set_contact(text, user_role)
self.update()
def import_contacts(self):
import_meta_gui(self.parent, _('contacts'), self.parent.contacts.import_file, self.update)