diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-07 01:00:20 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-07 01:00:21 +0200 |
commit | 295cd87c6d4cb6c9c1222fc565031377e5f33704 (patch) | |
tree | 31296727d5fed266d5d894d57827c139cb555108 /src/corelib | |
parent | 35ebdeb83eb4057f5e50042747b13d0772051459 (diff) | |
parent | 3bac18da8ef9f5750207ddf47192b5db3137c4ac (diff) |
Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp | 15 | ||||
-rw-r--r-- | src/corelib/doc/snippets/qstring/main.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qeasingcurve.cpp | 17 |
3 files changed, 18 insertions, 16 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] diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 5b640f3fdc..ac7fc7d078 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -291,7 +291,7 @@ void Widget::argFunction() //! [97] //! [98] - str = "%1%2%3"; + str = "%1%3%2"; str.arg("Hello", QString::number(20), QString::number(50)); // returns "Hello5020" //! [98] diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index e66db58ed7..235ca625c1 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -72,24 +72,15 @@ curve is a linear curve. This is the default behaviour. For example, - \code - QEasingCurve easing(QEasingCurve::InOutQuad); - for(qreal t = 0.0; t < 1.0; t+=0.1) - qWarning() << "Effective progress" << t << " is - << easing.valueForProgress(t); - \endcode + \snippet code/src_corelib_tools_qeasingcurve.cpp 0 + will print the effective progress of the interpolation between 0 and 1. When using a QPropertyAnimation, the associated easing curve will be used to control the progress of the interpolation between startValue and endValue: - \code - QPropertyAnimation animation; - animation.setStartValue(0); - animation.setEndValue(1000); - animation.setDuration(1000); - animation.setEasingCurve(QEasingCurve::InOutQuad); - \endcode + + \snippet code/src_corelib_tools_qeasingcurve.cpp 1 The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access is available to curves |