diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-09-03 14:02:13 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-10-15 10:55:18 +0000 |
commit | 1f6bfc220774e9407fe88916843b76ed103cff72 (patch) | |
tree | 8d6157d5b974e6045d75a716f8eb0db4daefa35f /src/corelib/animation | |
parent | 02a214442781bf112c1cc85d2470c6fcec8ed207 (diff) |
Doc: Move literal code block to a separate file
We need to override this snippet for the documentation
we generate for Qt for Python, and it is easier to have
it on a separate file.
Task-number: PYSIDE-801
Task-number: PYSIDE-691
Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/animation')
-rw-r--r-- | src/corelib/animation/qparallelanimationgroup.cpp | 8 | ||||
-rw-r--r-- | src/corelib/animation/qpropertyanimation.cpp | 9 | ||||
-rw-r--r-- | src/corelib/animation/qsequentialanimationgroup.cpp | 9 | ||||
-rw-r--r-- | src/corelib/animation/qvariantanimation.cpp | 14 |
4 files changed, 5 insertions, 35 deletions
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index e4dfc1bd6e..f3184d6e54 100644 --- a/src/corelib/animation/qparallelanimationgroup.cpp +++ b/src/corelib/animation/qparallelanimationgroup.cpp @@ -53,13 +53,7 @@ You can treat QParallelAnimationGroup as any other QAbstractAnimation, e.g., pause, resume, or add it to other animation groups. - \code - QParallelAnimationGroup *group = new QParallelAnimationGroup; - group->addAnimation(anim1); - group->addAnimation(anim2); - - group->start(); - \endcode + \snippet code/src_corelib_animation_qparallelanimationgroup.cpp 0 In this example, \c anim1 and \c anim2 are two \l{QPropertyAnimation}s that have already been set up. diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 5ba2a1fa73..f616dc71f8 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -56,14 +56,7 @@ makes it possible to animate many of Qt's widgets. Let's look at an example: - \code - 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(); - \endcode + \snippet code/src_corelib_animation_qpropertyanimation.cpp 0 The property name and the QObject instance of which property should be animated are passed to the constructor. You can then diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index f5f538337e..23725ae415 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -61,14 +61,7 @@ groups. You can also call addPause() or insertPause() to add a pause to a sequential animation group. - \code - QSequentialAnimationGroup *group = new QSequentialAnimationGroup; - - group->addAnimation(anim1); - group->addAnimation(anim2); - - group->start(); - \endcode + \snippet code/src_corelib_animation_qsequentialanimationgroup.cpp 0 In this example, \c anim1 and \c anim2 are two already set up \l{QPropertyAnimation}s. diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 3c90d71c7d..8711ec8a31 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -118,15 +118,7 @@ QT_BEGIN_NAMESPACE and the current progress. Example: - \code - QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress) - { - ... - return QColor(...); - } - ... - qRegisterAnimationInterpolator<QColor>(myColorInterpolator); - \endcode + \snippet code/src_corelib_animation_qvariantanimation.cpp 0 Another option is to reimplement interpolated(), which returns interpolation values for the value being interpolated. @@ -418,9 +410,7 @@ static QBasicMutex registeredInterpolatorsMutex; This is a typedef for a pointer to a function with the following signature: - \code - QVariant myInterpolator(const QVariant &from, const QVariant &to, qreal progress); - \endcode + \snippet code/src_corelib_animation_qvariantanimation.cpp 1 */ |