Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qquickframeanimation_p.h>
Public Slots | |
void | start () |
\qmlmethod QtQuick::FrameAnimation::start() | |
void | stop () |
\qmlmethod QtQuick::FrameAnimation::stop() | |
void | restart () |
\qmlmethod QtQuick::FrameAnimation::restart() | |
void | pause () |
\qmlmethod QtQuick::FrameAnimation::pause() | |
void | resume () |
\qmlmethod QtQuick::FrameAnimation::resume() | |
void | reset () |
\qmlmethod QtQuick::FrameAnimation::reset() | |
Public Slots inherited from QObject | |
void | deleteLater () |
\threadsafe | |
Signals | |
void | triggered () |
void | runningChanged () |
void | pausedChanged () |
void | currentFrameChanged () |
void | frameTimeChanged () |
void | smoothFrameTimeChanged () |
void | elapsedTimeChanged () |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QQuickFrameAnimation (QObject *parent=nullptr) | |
\qmltype FrameAnimation \nativetype QQuickFrameAnimation \inqmlmodule QtQuick | |
bool | isRunning () const |
\qmlsignal QtQuick::FrameAnimation::triggered() | |
void | setRunning (bool running) |
bool | isPaused () const |
\qmlproperty bool QtQuick::FrameAnimation::paused | |
void | setPaused (bool paused) |
int | currentFrame () const |
\qmlproperty int QtQuick::FrameAnimation::currentFrame \readonly | |
qreal | frameTime () const |
\qmlproperty qreal QtQuick::FrameAnimation::frameTime \readonly | |
qreal | smoothFrameTime () const |
\qmlproperty qreal QtQuick::FrameAnimation::smoothFrameTime \readonly | |
qreal | elapsedTime () const |
\qmlproperty qreal QtQuick::FrameAnimation::elapsedTime \readonly | |
Public Member Functions inherited from QObject | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T > | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Public Member Functions inherited from QQmlParserStatus | |
QQmlParserStatus () | |
virtual | ~QQmlParserStatus () |
Protected Member Functions | |
void | classBegin () override |
void | componentComplete () override |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Properties | |
bool | running |
bool | paused |
int | currentFrame |
qreal | frameTime |
qreal | smoothFrameTime |
qreal | elapsedTime |
Properties inherited from QObject | |
QString | objectName |
the name of this object | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 26 of file qquickframeanimation_p.h.
\qmltype FrameAnimation \nativetype QQuickFrameAnimation \inqmlmodule QtQuick
Triggers a handler at every animation frame update.
A FrameAnimation can be used to trigger an action every time animations have progressed and an animation frame has been rendered. See the documentation about the \l{qtquick-visualcanvas-scenegraph.html}{Scene Graph} for in-depth information about the threaded and basic render loops.
For general animations, prefer using NumberAnimation
and other Animation
elements as those provide declarative way to describe the animations.
FrameAnimation on the other hand should be used for custom imperative animations and in use-cases like these: \list
Compared to Timer
which allows to set the interval
time, FrameAnimation runs always in synchronization with the animation updates. If you have used Timer
with a short interval for custom animations like below, please consider switching to use FrameAnimation instead for smoother animations.
Definition at line 146 of file qquickframeanimation.cpp.
|
overrideprotectedvirtual |
Implements QQmlParserStatus.
Definition at line 421 of file qquickframeanimation.cpp.
|
overrideprotectedvirtual |
Implements QQmlParserStatus.
Definition at line 430 of file qquickframeanimation.cpp.
int QQuickFrameAnimation::currentFrame | ( | ) | const |
\qmlproperty int QtQuick::FrameAnimation::currentFrame \readonly
This property holds the number of frame updates since the start. When the frame animation is restarted, currentFrame starts from 0
.
The following example shows how to react on frame updates.
This property can also be used for rendering only every nth frame. Consider an advanced usage where the UI contains two heavy elements and to reach smooth 60fps overall frame rate, you decide to render these heavy elements at 30fps, first one on every even frames and second one on every odd frames:
By default, frame
is 0.
Definition at line 248 of file qquickframeanimation.cpp.
|
signal |
qreal QQuickFrameAnimation::elapsedTime | ( | ) | const |
\qmlproperty qreal QtQuick::FrameAnimation::elapsedTime \readonly
This property holds the time (in seconds) since the previous start.
By default, elapsedTime
is 0.
Definition at line 327 of file qquickframeanimation.cpp.
|
signal |
qreal QQuickFrameAnimation::frameTime | ( | ) | const |
\qmlproperty qreal QtQuick::FrameAnimation::frameTime \readonly
This property holds the time (in seconds) since the previous frame update.
The following example shows how to use frameTime to animate item with varying speed, adjusting to screen refresh rates and possible fps drops.
By default, frameTime
is 0.
Definition at line 285 of file qquickframeanimation.cpp.
|
signal |
bool QQuickFrameAnimation::isPaused | ( | ) | const |
\qmlproperty bool QtQuick::FrameAnimation::paused
If set to true, pauses the frame animation; otherwise resumes it.
paused defaults to false.
Definition at line 195 of file qquickframeanimation.cpp.
bool QQuickFrameAnimation::isRunning | ( | ) | const |
\qmlsignal QtQuick::FrameAnimation::triggered()
This signal is emitted when the FrameAnimation has progressed to a new frame.
\qmlproperty bool QtQuick::FrameAnimation::running
If set to true, starts the frame animation; otherwise stops it.
running defaults to false.
Definition at line 169 of file qquickframeanimation.cpp.
|
slot |
\qmlmethod QtQuick::FrameAnimation::pause()
Pauses the frame animation
If the frame animation is already paused or not running
, calling this method has no effect. The paused
property will be true following a call to pause()
.
Definition at line 379 of file qquickframeanimation.cpp.
|
signal |
|
slot |
\qmlmethod QtQuick::FrameAnimation::reset()
Resets the frame animation properties
Calling this method resets the frame
and elapsedTime
to their initial values (0). This method has no effect on running
or paused
properties and can be called while they are true or false.
The difference between calling reset()
and restart()
is that reset()
will always initialize the properties while restart()
initializes them only at the next frame update which doesn't happen e.g. if restart()
is immediately followed by pause()
.
Definition at line 409 of file qquickframeanimation.cpp.
|
slot |
\qmlmethod QtQuick::FrameAnimation::restart()
Restarts the frame animation
If the FrameAnimation is not running it will be started, otherwise it will be stopped, reset to initial state and started. The running
property will be true following a call to restart()
.
Definition at line 366 of file qquickframeanimation.cpp.
|
slot |
\qmlmethod QtQuick::FrameAnimation::resume()
Resumes a paused frame animation
If the frame animation is not paused or not running
, calling this method has no effect. The paused
property will be false following a call to resume()
.
Definition at line 391 of file qquickframeanimation.cpp.
|
signal |
void QQuickFrameAnimation::setPaused | ( | bool | paused | ) |
Definition at line 201 of file qquickframeanimation.cpp.
void QQuickFrameAnimation::setRunning | ( | bool | running | ) |
Definition at line 175 of file qquickframeanimation.cpp.
qreal QQuickFrameAnimation::smoothFrameTime | ( | ) | const |
\qmlproperty qreal QtQuick::FrameAnimation::smoothFrameTime \readonly
This property holds the smoothed time (in seconds) since the previous frame update.
The following example shows how to use smoothFrameTime to show average fps.
By default, smoothFrameTime
is 0.
Definition at line 313 of file qquickframeanimation.cpp.
|
signal |
|
slot |
\qmlmethod QtQuick::FrameAnimation::start()
Starts the frame animation
If the frame animation is already running, calling this method has no effect. The running
property will be true following a call to start()
.
Definition at line 340 of file qquickframeanimation.cpp.
|
slot |
\qmlmethod QtQuick::FrameAnimation::stop()
Stops the frame animation
If the frame animation is not running, calling this method has no effect. Both the running
and paused
properties will be false following a call to stop()
.
Definition at line 352 of file qquickframeanimation.cpp.
|
signal |
|
read |
Definition at line 33 of file qquickframeanimation_p.h.
|
read |
Definition at line 36 of file qquickframeanimation_p.h.
|
read |
Definition at line 34 of file qquickframeanimation_p.h.
|
readwrite |
Definition at line 32 of file qquickframeanimation_p.h.
|
readwrite |
Definition at line 31 of file qquickframeanimation_p.h.
|
read |
Definition at line 35 of file qquickframeanimation_p.h.