Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qeasingcurve.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QEASINGCURVE_H
5#define QEASINGCURVE_H
6
7#include <QtCore/qglobal.h>
8
9QT_REQUIRE_CONFIG(easingcurve);
10
11#include <QtCore/qlist.h>
12#include <QtCore/qobjectdefs.h>
13
15
17class QPointF;
18class Q_CORE_EXPORT QEasingCurve
19{
21public:
22 enum Type {
24 InQuad, OutQuad, InOutQuad, OutInQuad,
25 InCubic, OutCubic, InOutCubic, OutInCubic,
26 InQuart, OutQuart, InOutQuart, OutInQuart,
27 InQuint, OutQuint, InOutQuint, OutInQuint,
28 InSine, OutSine, InOutSine, OutInSine,
29 InExpo, OutExpo, InOutExpo, OutInExpo,
30 InCirc, OutCirc, InOutCirc, OutInCirc,
31 InElastic, OutElastic, InOutElastic, OutInElastic,
32 InBack, OutBack, InOutBack, OutInBack,
33 InBounce, OutBounce, InOutBounce, OutInBounce,
34 InCurve, OutCurve, SineCurve, CosineCurve,
35 BezierSpline, TCBSpline, Custom, NCurveTypes
36 };
38
42
44 { if ( this != &other ) { QEasingCurve copy(other); swap(copy); } return *this; }
45 QEasingCurve(QEasingCurve &&other) noexcept : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
46 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QEasingCurve)
47
48 void swap(QEasingCurve &other) noexcept { qt_ptr_swap(d_ptr, other.d_ptr); }
49
50 bool operator==(const QEasingCurve &other) const;
51 inline bool operator!=(const QEasingCurve &other) const
52 { return !(this->operator==(other)); }
53
54 qreal amplitude() const;
55 void setAmplitude(qreal amplitude);
56
57 qreal period() const;
58 void setPeriod(qreal period);
59
60 qreal overshoot() const;
61 void setOvershoot(qreal overshoot);
62
63 void addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint);
64 void addTCBSegment(const QPointF &nextPoint, qreal t, qreal c, qreal b);
65 QList<QPointF> toCubicSpline() const;
66
67 Type type() const;
68 void setType(Type type);
69 typedef qreal (*EasingFunction)(qreal progress);
70 void setCustomType(EasingFunction func);
71 EasingFunction customType() const;
72
73 qreal valueForProgress(qreal progress) const;
74
75private:
77#ifndef QT_NO_DEBUG_STREAM
78 friend Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QEasingCurve &item);
79#endif
80#ifndef QT_NO_DATASTREAM
81 friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QEasingCurve &);
82 friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &);
83#endif
84};
85Q_DECLARE_SHARED(QEasingCurve)
86
87#ifndef QT_NO_DEBUG_STREAM
88Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QEasingCurve &item);
89#endif
90
91#ifndef QT_NO_DATASTREAM
92Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QEasingCurve &);
94#endif
95
97
98#endif
\inmodule QtCore\reentrant
Definition qdatastream.h:30
\inmodule QtCore
\inmodule QtCore
QEasingCurve(QEasingCurve &&other) noexcept
Move-constructs a QEasingCurve instance, making it point at the same object that other was pointing t...
bool operator!=(const QEasingCurve &other) const
Compare this easing curve with other and returns true if they are not equal.
QEasingCurve & operator=(const QEasingCurve &other)
Copy other.
Definition qlist.h:74
\inmodule QtCore\reentrant
Definition qpoint.h:214
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QEasingCurve &)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QEasingCurve &item)
GLboolean GLboolean GLboolean b
GLenum type
GLenum func
Definition qopenglext.h:663
const GLubyte * c
GLdouble GLdouble t
Definition qopenglext.h:243
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
constexpr void qt_ptr_swap(T *&lhs, T *&rhs) noexcept
Definition qswap.h:43
#define QT_REQUIRE_CONFIG(feature)
#define Q_ENUM(x)
#define Q_GADGET
double qreal
Definition qtypes.h:92
QDataStream & operator<<(QDataStream &out, const MyClass &myObj)
[4]
QDataStream & operator>>(QDataStream &in, MyClass &myObj)
MyCustomStruct c2
QSharedPointer< T > other(t)
[5]
this swap(other)
QGraphicsItem * item
proxy setType(QNetworkProxy::Socks5Proxy)
Definition moc.h:24