I'm doing a form that contains a QListView. It's populated from database with this code:
model = QStandardItemModel(self.listUser)
for row in self.SELECT_USERS_ACCOUNTS():
item = QStandardItem(str(row[1]))
model.appendRow(item)
self.listUser.setModel(model)
My QListView is named listUser and SELECT_USERS_ACCOUNTS() function returns data created by select id,name from table_user, I need to store row[0] (id column in the table_user) too because when the user will click an item into the QListView. I want to capture this Id. Thanks in advance.