def METHOD_NAME(self, change, value):
    if (change == QtWidgets.QGraphicsItem.ItemPositionChange):
        newpos = QtCore.QPointF(value)
        div = 0
        if newpos.y() < self.pos().y():
            div = 1
        if newpos.y() > self.pos().y():
            div = -1
        hit = 0
        rect = self.scene().sceneRect()
        if (newpos.y() >= self.lower):
            newpos.setY(self.lower)
            hit = 1
        if (newpos.y() <= self.upper):
            newpos.setY(self.upper)
            hit = 1
        if not(hit):
            self.attenChanged.emit(div)
        return QtCore.QPointF(self.pos().x(), newpos.y())
    return QtWidgets.QGraphicsItem.METHOD_NAME(self, change, value)