summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2018-07-24 15:29:16 +0200
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2018-09-03 12:31:07 +0000
commitff2a71e310b18a43a41daf2d197f5715f7c26d29 (patch)
tree018e2c1b7ad98da1b4a05fcca1bfaec8a643dffc /src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
parenta381ba4220097bd7a982a86f32c7e65da5591c8c (diff)
Doc: Move the literal code blocks to a separate file
It's easier to override the code blocks this way. Change-Id: I98d40626a94fdb70a95c50332c2da141e9277070 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
index 0485bd290a..97453e2b06 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -49,6 +49,17 @@
****************************************************************************/
//! [0]
-qreal myEasingFunction(qreal progress);
+ QEasingCurve easing(QEasingCurve::InOutQuad);
+
+ for (qreal t = 0.0; t < 1.0; t+=0.1)
+ qWarning() << "Effective progress" << t << " is
+ << easing.valueForProgress(t);
//! [0]
+//! [1]
+ QPropertyAnimation animation;
+ animation.setStartValue(0);
+ animation.setEndValue(1000);
+ animation.setDuration(1000);
+ animation.setEasingCurve(QEasingCurve::InOutQuad);
+//! [1]