def METHOD_NAME(self, event):
    painter = QtGui.QPainter(self)
    opt = QtWidgets.QStyleOptionSlider()
    self.initStyleOption(opt)
    painter.fillRect(event.rect(), QtCore.Qt.transparent)
    painter.setRenderHint(QtGui.QPainter.HighQualityAntialiasing)
    horizontal = self.orientation() == QtCore.Qt.Horizontal
    rect = self.style().subControlRect(
        QtWidgets.QStyle.CC_Slider,
        opt,
        QtWidgets.QStyle.SC_SliderGroove,
        self
    )
    _range = self.maximum() - self.minimum()
    _offset = self.value() - self.minimum()
    if horizontal:
        _handle_half = rect.height() / 2
        _handle_size = _handle_half * 2
        width = rect.width() - _handle_size
        pos_x = ((width / _range) * _offset)
        pos_y = rect.center().y() - _handle_half + 1
    else:
        _handle_half = rect.width() / 2
        _handle_size = _handle_half * 2
        height = rect.height() - _handle_size
        pos_x = rect.center().x() - _handle_half + 1
        pos_y = height - ((height / _range) * _offset)
    handle_rect = QtCore.QRect(
        pos_x, pos_y, _handle_size, _handle_size
    )
    self._handle_size = _handle_size
    _offset = 2
    _size = _handle_size - _offset
    if horizontal:
        if rect.height() > _size:
            new_rect = QtCore.QRect(0, 0, rect.width(), _size)
            center_point = QtCore.QPoint(
                rect.center().x(), handle_rect.center().y()
            )
            new_rect.moveCenter(center_point)
            rect = new_rect
        ratio = rect.height() / 2
        fill_rect = QtCore.QRect(
            rect.x(),
            rect.y(),
            handle_rect.right() - rect.x(),
            rect.height()
        )
    else:
        if rect.width() > _size:
            new_rect = QtCore.QRect(0, 0, _size, rect.height())
            center_point = QtCore.QPoint(
                handle_rect.center().x(), rect.center().y()
            )
            new_rect.moveCenter(center_point)
            rect = new_rect
        ratio = rect.width() / 2
        fill_rect = QtCore.QRect(
            rect.x(),
            handle_rect.y(),
            rect.width(),
            rect.height() - handle_rect.y(),
        )
    painter.save()
    painter.setPen(QtCore.Qt.NoPen)
    painter.setBrush(self._bg_brush)
    painter.drawRoundedRect(rect, ratio, ratio)
    painter.setBrush(self._fill_brush)
    painter.drawRoundedRect(fill_rect, ratio, ratio)
    painter.setPen(QtCore.Qt.NoPen)
    painter.setBrush(self._fill_brush)
    painter.drawEllipse(handle_rect)
    painter.restore()