def mousePressEvent(self, event):
print(Qt.Vertical)
if event.button() == Qt.LeftButton:
if self.orientation() == Qt.Vertical:
self.setValue(self.minimum() + ((self.maximum() - self.minimum()) * (self.height() - event.y())) / self.height() )
else:
self.setValue(self.minimum() + ((self.maximum() - self.minimum()) * event.x()) / self.width())
event.accept()