code: def data(self, index, role=Qt.DisplayRole):
          
          row = index.row()
          if not index.isValid() or not (0 <= row < len(self.shortcuts)):
              return to_qvariant()
  
          shortcut = self.shortcuts[row]
          key = shortcut.key
          column = index.column()
  
          if role == Qt.DisplayRole:
              if column == CONTEXT:
                  return to_qvariant(shortcut.context)
              elif column == NAME:
                  color = self.text_color
                  if self._parent == QApplication.focusWidget():
                      if self.current_index().row() == row:
                          color = self.text_color_highlight
                      else:
                          color = self.text_color
                  text = self.rich_text[row]
                  text = '<p style="color:{0}">{1}</p>'.format(color, text)
                  return to_qvariant(text)
              elif column == SEQUENCE:
                  text = QKeySequence(key).toString(QKeySequence.NativeText)
                  return to_qvariant(text)
              elif column == SEARCH_SCORE:
                  # Treating search scores as a table column simplifies the
                  # sorting once a score for a specific string in the finder
                  # has been defined. This column however should always remain
                  # hidden.
                  return to_qvariant(self.scores[row])
          elif role == Qt.TextAlignmentRole:
              return to_qvariant(int(Qt.AlignHCenter | Qt.AlignVCenter))
          return to_qvariant()
docs: Qt Override.