Skip to content

Commit 48f43b0

Browse files
committedDec 9, 2016
Fix map canvas test
1 parent cf5f373 commit 48f43b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎tests/src/gui/testqgsmapcanvas.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,25 +316,25 @@ void TestQgsMapCanvas::testZoomByWheel()
316316
mCanvas->setWheelFactor( 2 );
317317

318318
//test zoom out
319-
QWheelEvent e( QPoint( 0, 0 ), -1, Qt::NoButton, Qt::NoModifier );
319+
QWheelEvent e( QPoint( 0, 0 ), -QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::NoModifier );
320320
mCanvas->wheelEvent( &e );
321321
QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth * 2.0, 0.1 );
322322
QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight * 2.0, 0.1 );
323323

324324
//test zoom in
325-
e = QWheelEvent( QPoint( 0, 0 ), 1, Qt::NoButton, Qt::NoModifier );
325+
e = QWheelEvent( QPoint( 0, 0 ), QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::NoModifier );
326326
mCanvas->wheelEvent( &e );
327327
QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth, 0.1 );
328328
QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight, 0.1 );
329329

330330
// test zoom out with ctrl
331-
e = QWheelEvent( QPoint( 0, 0 ), -1, Qt::NoButton, Qt::ControlModifier );
331+
e = QWheelEvent( QPoint( 0, 0 ), -QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::ControlModifier );
332332
mCanvas->wheelEvent( &e );
333333
QGSCOMPARENEAR( mCanvas->extent().width(), 1.05 * originalWidth, 0.1 );
334334
QGSCOMPARENEAR( mCanvas->extent().height(), 1.05 * originalHeight, 0.1 );
335335

336336
//test zoom in with ctrl
337-
e = QWheelEvent( QPoint( 0, 0 ), 1, Qt::NoButton, Qt::ControlModifier );
337+
e = QWheelEvent( QPoint( 0, 0 ), QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::ControlModifier );
338338
mCanvas->wheelEvent( &e );
339339
QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth, 0.1 );
340340
QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight, 0.1 );

0 commit comments

Comments
 (0)
Please sign in to comment.