Commit 4f98817d authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[FIX #483] use angleDelta as requested by deprecation warning

parent ee22a04f
......@@ -357,16 +357,9 @@ void WQtGLWidget::wheelEvent( QWheelEvent* event )
if( m_Viewer )
{
int x, y;
if( event->orientation() == Qt::Vertical )
{
x = 0;
y = event->delta();
}
else
{
x = event->delta();
y = 0;
}
x = event->angleDelta().x();
y = event->angleDelta().y();
m_Viewer->mouseEvent( WGEViewer::MOUSESCROLL, x, y, 0 );
}
}
......
......@@ -231,12 +231,15 @@ void WQtNetworkEditorView::wheelEvent( QWheelEvent* event )
{
// scale the view ie. do the zoom
double scaleFactor = 1.15;
if( event->delta() > 0 )
if( event->angleDelta().y() > 0 )
{
// zoom in
scale( scaleFactor, scaleFactor );
}
else
// We check both because smaller AND larger than zero because
// we want to handle y events and ignore x events
else if( event->angleDelta().y() < 0 )
{
// zooming out
scale( 1.0 / scaleFactor, 1.0 / scaleFactor );
......@@ -276,4 +279,3 @@ void WQtNetworkEditorView::dropEvent( QDropEvent* event )
emit dragDrop( event );
QGraphicsView::dropEvent( event );
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment