I was using the delta() function from the QWheelEvent class to achieve the zoom in, zoom out. now it is deprecated, and they advise in the documentation to use pixelDelta() or angleDelta() instead, but they are QPoint objects!
can anybody please tell me how to replace this deprecated function with another ones?
void MapView::wheelEvent(QWheelEvent *event)
{
if(event->delta()>0)
{
if(m_scale < MAX_SCALE)
{
std::cout << m_scale << std::endl;
this->scale(ZOOM_STEP, ZOOM_STEP);
m_scale *= ZOOM_STEP;
}
}
else if(event->delta() < 0)
{
if(m_scale >= MIN_SCALE)
{
std::cout << m_scale << std::endl;
this->scale(1/ZOOM_STEP, 1/ZOOM_STEP);
m_scale *= 1/ZOOM_STEP;
}
}
}