summaryrefslogtreecommitdiffstats
path: root/examples/widgets/scribble/scribblearea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/scribble/scribblearea.cpp')
-rw-r--r--examples/widgets/scribble/scribblearea.cpp5
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]