From ecdecf7a628aa1c9eb953984c89fc65ffa767a24 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 9 Nov 2009 17:44:54 +0100 Subject: Fix docs for animation api All animation api code snippets should use references instead of local variables. Task-number: QTBUG-5616 Reviewed-by: thierry --- src/corelib/animation/qpropertyanimation.cpp | 10 +++++----- src/corelib/animation/qsequentialanimationgroup.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/corelib/animation') diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 30650831bc..013ff7fe54 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -58,12 +58,12 @@ an example: \code - QPropertyAnimation animation(myWidget, "geometry"); - animation.setDuration(10000); - animation.setStartValue(QRect(0, 0, 100, 30)); - animation.setEndValue(QRect(250, 250, 100, 30)); + QPropertyAnimation *animation = new QPropertyAnimation(myWidget, "geometry"); + animation->setDuration(10000); + animation->setStartValue(QRect(0, 0, 100, 30)); + animation->setEndValue(QRect(250, 250, 100, 30)); - animation.start(); + animation->start(); \endcode The property name and the QObject instance of which property diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 861e26e78f..5dbb8c3d10 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -63,12 +63,12 @@ pause to a sequential animation group. \code - QSequentialAnimationGroup group; + QSequentialAnimationGroup *group = new QSequentialAnimationGroup; - group.addAnimation(anim1); - group.addAnimation(anim2); + group->addAnimation(anim1); + group->addAnimation(anim2); - group.start(); + group->start(); \endcode In this example, \c anim1 and \c anim2 are two already set up -- cgit v1.2.3