
        if (orientation() == Qt::Vertical)
        {
            pressedPos = minimum() + ((maximum() - minimum()) * (height() - event->y())) / height();
        }
        else
        {
            pressedPos = minimum() + ((maximum() - minimum()) * event->x()) / width();
        }

        setValue(pressedPos);