2 * Copyright 2014 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
23#include <QEasingCurve>
26 * @brief The EasingCurve class
28 * This class exposes the QEasingCurve C++ API to QML.
29 * This is useful for user interactive animations. While the QML Animation types
30 * all require a "from", "to" and "duration", this one is based on "period" and
31 * "progress". So you can control the position of the animation by changing the
32 * progress, also going back and forward in the aimation. Depending on the type
33 * of the easing curve, value will return the transformed progress.
36class EasingCurve: public QObject
39 Q_ENUMS(QEasingCurve::Type)
40 Q_PROPERTY(QEasingCurve::Type type READ type WRITE setType NOTIFY typeChanged)
41 Q_PROPERTY(qreal period READ period WRITE setPeriod NOTIFY periodChanged)
42 Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
43 Q_PROPERTY(qreal value READ value NOTIFY progressChanged)
46 EasingCurve(QObject *parent = 0);
48 QEasingCurve::Type type() const;
49 void setType(const QEasingCurve::Type &type);
52 void setPeriod(qreal period);
54 qreal progress() const;
55 void setProgress(qreal progress);
62 void progressChanged();
65 QEasingCurve m_easingCurve;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list