diff options
author | Daniil Ivanov <divanov@iv1.research.nokia.com> | 2009-11-26 13:44:09 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-26 13:44:09 (GMT) |
commit | d014d49c88d4fa31c46afb2c252e481177b30a55 (patch) | |
tree | dbb80fc0486d0cdcedf4c23368548f41e1864edb /examples | |
parent | 705880f0045ac39140f980d69aec68869213e379 (diff) | |
download | Qt-d014d49c88d4fa31c46afb2c252e481177b30a55.zip Qt-d014d49c88d4fa31c46afb2c252e481177b30a55.tar.gz Qt-d014d49c88d4fa31c46afb2c252e481177b30a55.tar.bz2 |
Fixes performance problem with scribble avoiding to redraw whole screen on every MotionNotify event.
Merge-request: 2210
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/widgets/scribble/scribblearea.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/widgets/scribble/scribblearea.cpp b/examples/widgets/scribble/scribblearea.cpp index 6c9d8aa..2bc2a69 100644 --- a/examples/widgets/scribble/scribblearea.cpp +++ b/examples/widgets/scribble/scribblearea.cpp @@ -139,11 +139,12 @@ void ScribbleArea::mouseReleaseEvent(QMouseEvent *event) } //! [12] //! [13] -void ScribbleArea::paintEvent(QPaintEvent * /* event */) +void ScribbleArea::paintEvent(QPaintEvent *event) //! [13] //! [14] { QPainter painter(this); - painter.drawImage(QPoint(0, 0), image); + QRect dirtyRect = event->rect(); + painter.drawImage(dirtyRect, image, dirtyRect); } //! [14] |