Exemplo n.º 1
0
 def paint(self, painter: QPainter, option: QStyleOptionViewItem,
           index: QModelIndex):
     """
     Reposition the icon to the right side.
     """
     option.decorationPosition = QStyleOptionViewItem.Right
     option.decorationAlignment = Qt.AlignRight | Qt.AlignVCenter
     super(EditorDelegate, self).paint(painter, option, index)
    def paint(self, painter: QPainter, option: QStyleOptionViewItem,
              index: QModelIndex):
        if self._decoration_position is not None:
            option.decorationPosition = self._decoration_position

        if self._decoration_alignment is not None:
            option.decorationAlignment = self._decoration_alignment

        super(StyleOptionModifyingDelegate, self).paint(painter, option, index)