summaryrefslogtreecommitdiffstats
path: root/examples/widgets/animation/easing/animation.h
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2022-09-08 12:56:24 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-16 06:52:57 +0000
commitf442fcaa6c566e71b8c9f624f6561b9e785b4ddb (patch)
tree884cf608d8d114354c9991ddc664193c3795d13c /examples/widgets/animation/easing/animation.h
parentb46e17918675f2130e6faa792ce51fee7d890ad5 (diff)
Pass a parent pointer to the Animation instance to avoid memory leak
The leak is just on termination, but we should show good practices in our examples Change-Id: I39abb7545d3c68a1a537b865ba3fcb5e60c22fbf Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit 30947c7fd4dddd76b69a3aa11567e27174d7a3ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/widgets/animation/easing/animation.h')
-rw-r--r--examples/widgets/animation/easing/animation.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/animation/easing/animation.h b/examples/widgets/animation/easing/animation.h
index 696257bb4a..d78997d5ff 100644
--- a/examples/widgets/animation/easing/animation.h
+++ b/examples/widgets/animation/easing/animation.h
@@ -62,8 +62,8 @@ public:
CirclePath,
NPathTypes
};
- Animation(QObject *target, const QByteArray &prop)
- : QPropertyAnimation(target, prop)
+ Animation(QObject *target, const QByteArray &prop, QObject *parent = nullptr)
+ : QPropertyAnimation(target, prop, parent)
{
setPathType(LinearPath);
}