Commit 8e01c0fd authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Prefer QWidget::update to QWidget::repaint

It blocks on rendering, which makes scrolling noticeably slow on systems
with high resolution scrolling.

Reviewed by Albert Astals
parent 0602576c
...@@ -1614,7 +1614,7 @@ bool PageView::gestureEvent( QGestureEvent * event ) ...@@ -1614,7 +1614,7 @@ bool PageView::gestureEvent( QGestureEvent * event )
d->blockPixmapsRequest = true; d->blockPixmapsRequest = true;
updateZoom( ZoomRefreshCurrent ); updateZoom( ZoomRefreshCurrent );
d->blockPixmapsRequest = false; d->blockPixmapsRequest = false;
viewport()->repaint(); viewport()->update();
} }
// Count the number of 90-degree rotations we did since the start of the pinch gesture. // Count the number of 90-degree rotations we did since the start of the pinch gesture.
...@@ -2129,7 +2129,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e ) ...@@ -2129,7 +2129,7 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
d->blockPixmapsRequest = true; d->blockPixmapsRequest = true;
updateZoom( ZoomRefreshCurrent ); updateZoom( ZoomRefreshCurrent );
d->blockPixmapsRequest = false; d->blockPixmapsRequest = false;
viewport()->repaint(); viewport()->update();
} }
return; return;
} }
...@@ -3431,8 +3431,9 @@ void PageView::scrollContentsBy( int dx, int dy ) ...@@ -3431,8 +3431,9 @@ void PageView::scrollContentsBy( int dx, int dy )
// thus leaving artifacts around // thus leaving artifacts around
QRegion rgn( r ); QRegion rgn( r );
rgn -= rgn & r.translated( dx, dy ); rgn -= rgn & r.translated( dx, dy );
foreach ( const QRect &rect, rgn.rects() ) foreach ( const QRect &rect, rgn.rects() )
viewport()->repaint( rect ); viewport()->update( rect );
} }
//END widget events //END widget events
......
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