From 8eaa9b90a6ae9f9edbf961bb4585aaa813f8a1ad Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete <paul.tvete@qt.io> Date: Tue, 22 May 2018 16:07:53 +0200 Subject: [PATCH] QObject::killTimers() doesn't exist anymore Now we have to kill timers individually. --- t14/cannon.cpp | 4 ++-- t14/cannon.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/t14/cannon.cpp b/t14/cannon.cpp index 68b9a95..e02fea0 100644 --- a/t14/cannon.cpp +++ b/t14/cannon.cpp @@ -61,7 +61,7 @@ void CannonField::shoot() shoot_ang = ang; shoot_f = f; shooting = true; - startTimer( 50 ); + timerId = startTimer( 50 ); } void CannonField::newTarget() @@ -170,7 +170,7 @@ void CannonField::mouseReleaseEvent( QMouseEvent *e ) void CannonField::stopShooting() { shooting = false; - killTimers(); + killTimer(timerId); } void CannonField::paintShot( QPainter *p ) diff --git a/t14/cannon.h b/t14/cannon.h index 8e64849..cf9724f 100644 --- a/t14/cannon.h +++ b/t14/cannon.h @@ -55,6 +55,7 @@ private: bool shooting; int timerCount; + int timerId; float shoot_ang; float shoot_f; -- GitLab