diff options
Diffstat (limited to 'examples/graphicsview/collidingmice/mouse.cpp')
-rw-r--r-- | examples/graphicsview/collidingmice/mouse.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/graphicsview/collidingmice/mouse.cpp b/examples/graphicsview/collidingmice/mouse.cpp index 1d10574..bbdb4e3 100644 --- a/examples/graphicsview/collidingmice/mouse.cpp +++ b/examples/graphicsview/collidingmice/mouse.cpp @@ -65,7 +65,6 @@ Mouse::Mouse() color(qrand() % 256, qrand() % 256, qrand() % 256) { rotate(qrand() % (360 * 16)); - startTimer(1000 / 33); } //! [0] @@ -123,8 +122,10 @@ void Mouse::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * //! [3] //! [4] -void Mouse::timerEvent(QTimerEvent *) +void Mouse::advance(int step) { + if (!step) + return; //! [4] // Don't move too far away //! [5] |