def METHOD_NAME(self, index, role=None):
    """Must be reimplemented when subclassing.
    Args:
        index (QModelIndex): Requested index
        role (int): Data role
    Returns:
        Data according to requested role
    """
    if not index.isValid() or self.rowCount() == 0:
        return None
    row = index.row()
    if role == Qt.ItemDataRole.DisplayRole:
        return self._spec_names[row]
    if role == Qt.ItemDataRole.ToolTipRole:
        if row >= self.rowCount():
            return ""
        return (
            "<p>Drag-and-drop this onto the Design View "
            f"to create a new <b>{self._spec_names[row]}</b> item.</p>"
        )
    if role == Qt.ItemDataRole.DecorationRole:
        spec = self.specification(row)
        return self._icons[spec.item_type]