for project in self.projects:
item = QtGui.QStandardItem()
item.setData(project['title'], QtCore.Qt.DisplayRole)
item.setData(project['id'], QtCore.Qt.UserRole)
item.setCheckable(False)
self.model.appendRow(item)
I then append the QStandardItemModel to the QCombobox and it displays the title as expected - sweet! However, I am not sure how I will go about retrieving the underlying id. Currently, I use projectList.currentText() Which works for getting the
current display value of the combo box, but how do I reach the underlying current QStandardItem and its id?
Also, if there's anything I have misunderstood regarding how to work with these elements I'd be happy if it got pointed out.
Thanks!