def METHOD_NAME(self, index, role=Qt.DisplayRole):
    if not index.isValid():
        return QVariant()
    row = index.row()
    item = self.items[row]
    if role == Qt.UserRole:
        return item
    return QVariant()