Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtCore.QVariantAnimation Class Referenceabstract

The QVariantAnimation class provides an abstract base class for animations. More...

Inheritance diagram for QtCore.QVariantAnimation:
Collaboration diagram for QtCore.QVariantAnimation:

Public Member Functions

 QVariantAnimation (QObject parent=null)
 
 
override void CreateProxy ()
 
new void SetDuration (int msecs)
 
override int Duration ()
 
override bool OnEvent (QEvent @event)
 
 
new object KeyValueAt (double step)
 
 
new void SetKeyValueAt (double step, object value)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QAbstractAnimation
 QAbstractAnimation (QObject parent=null)
 
 
new int CurrentLoopTime ()
 
 
override bool OnEvent (QEvent @event)
 
 
new QAnimationGroup Group ()
 
 
new void Pause ()
 
 
new void Resume ()
 
 
new void SetPaused (bool arg1)
 
 
new void Start (QAbstractAnimation.DeletionPolicy policy=QAbstractAnimation.DeletionPolicy.KeepWhenStopped)
 
 
new void Stop ()
 
 
new int TotalDuration ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool OnEvent (QEvent arg1)
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QAbstractAnimation
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QVariantAnimation (System.Type dummy)
 
virtual object Interpolated (object from, object to, double progress)
 
 
override void UpdateCurrentTime (int arg1)
 
 
abstract void UpdateCurrentValue (object value)
 
 
override void UpdateState (QAbstractAnimation.State newState, QAbstractAnimation.State oldState)
 
 
new void OnValueChanged (object value)
 
 
- Protected Member Functions inherited from QtCore.QAbstractAnimation
 QAbstractAnimation (System.Type dummy)
 
new void OnCurrentLoopChanged (int currentLoop)
 
 
new void OnDirectionChanged (QAbstractAnimation.Direction arg1)
 
 
new void OnFinished ()
 
 
new void OnStateChanged (QAbstractAnimation.State newState, QAbstractAnimation.State oldState)
 
 
virtual void UpdateDirection (QAbstractAnimation.Direction direction)
 
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

Slot< System.Object > ValueChanged
 
 
new object StartValue [get, set]
 
 
new object EndValue [get, set]
 
 
new object CurrentValue [get]
 
 
new QEasingCurve EasingCurve [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQVariantAnimationSignals Emit [get]
 
- Properties inherited from QtCore.QAbstractAnimation
Slot Finished
 
 
Slot< QAbstractAnimation.State,
QAbstractAnimation.State
StateChanged
 
 
Slot< System.Int32 > CurrentLoopChanged
 
 
Slot
< QAbstractAnimation.Direction
DirectionChanged
 
 
new State state [get]
 
 
new int LoopCount [get, set]
 
 
new int CurrentTime [get, set]
 
 
new int CurrentLoop [get]
 
 
new Direction direction [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractAnimationSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Public Types inherited from QtCore.QAbstractAnimation
enum  DeletionPolicy { DeleteWhenStopped = 1, KeepWhenStopped = 0 }
 
enum  Direction { Backward = 1, Forward = 0 }
  More...
 
enum  State { Paused = 1, Running = 2, Stopped = 0 }
  More...
 
- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QVariantAnimation class provides an abstract base class for animations.

This class is part of The Animation Framework. It serves as a base class for property and item animations, with functions for shared functionality.

QVariantAnimation cannot be used directly as it is an abstract class; it has a pure virtual method called updateCurrentValue(). The class performs interpolation over QVariants, but leaves using the interpolated values to its subclasses. Currently, Qt provides QPropertyAnimation, which animates Qt properties. See the QPropertyAnimation class description if you wish to animate such properties.

You can then set start and end values for the property by calling setStartValue() and setEndValue(), and finally call start() to start the animation. QVariantAnimation will interpolate the property of the target object and emit valueChanged(). To react to a change in the current value you have to reimplement the updateCurrentValue() virtual function.

It is also possible to set values at specified steps situated between the start and end value. The interpolation will then touch these points at the specified steps. Note that the start and end values are defined as the key values at 0.0 and 1.0.

There are two ways to affect how QVariantAnimation interpolates the values. You can set an easing curve by calling setEasingCurve(), and configure the duration by calling setDuration(). You can change how the QVariants are interpolated by creating a subclass of QVariantAnimation, and reimplementing the virtual interpolated() function.

Subclassing QVariantAnimation can be an alternative if you have QVariants that you do not wish to declare as Qt properties. Note, however, that you in most cases will be better off declaring your QVariant as a property.

Not all QVariant types are supported. Below is a list of currently supported QVariant types:

Int

Double

Float

QLine

QLineF

QPoint

QPointF

QSize

QSizeF

QRect

QRectF

QColor

If you need to interpolate other variant types, including custom types, you have to implement interpolation for these yourself. To do this, you can register an interpolator function for a given type. This function takes 3 parameters: the start value, the end value and the current progress.

Example:

QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress)

{

...

return QColor(...);

}

...

qRegisterAnimationInterpolator<QColor>(myColorInterpolator);

Another option is to reimplement interpolated(), which returns interpolation values for the value being interpolated.

See also QPropertyAnimation, QAbstractAnimation, and The Animation Framework.

Constructor & Destructor Documentation

QtCore.QVariantAnimation.QVariantAnimation ( System.Type  dummy)
protected
QtCore.QVariantAnimation.QVariantAnimation ( QObject  parent = null)

Construct a QVariantAnimation object. parent is passed to QAbstractAnimation's constructor.

Member Function Documentation

override void QtCore.QVariantAnimation.CreateProxy ( )
virtual

Reimplemented from QtCore.QAbstractAnimation.

new void QtCore.QVariantAnimation.Dispose ( )
override int QtCore.QVariantAnimation.Duration ( )
virtual
virtual object QtCore.QVariantAnimation.Interpolated ( object  from,
object  to,
double  progress 
)
protectedvirtual

This virtual function returns the linear interpolation between variants from and to, at progress, usually a value between 0 and 1. You can reimplement this function in a subclass of QVariantAnimation to provide your own interpolation algorithm.

Note that in order for the interpolation to work with a QEasingCurve that return a value smaller than 0 or larger than 1 (such as QEasingCurve::InBack) you should make sure that it can extrapolate. If the semantic of the datatype does not allow extrapolation this function should handle that gracefully.

You should call the QVariantAnimation implementation of this function if you want your class to handle the types already supported by Qt (see class QVariantAnimation description for a list of supported types).

See also QEasingCurve.

new object QtCore.QVariantAnimation.KeyValueAt ( double  step)

Returns the key frame value for the given step. The given step must be in the range 0 to 1. If there is no KeyValue for step, it returns an invalid QVariant.

See also keyValues() and setKeyValueAt().

override bool QtCore.QVariantAnimation.OnEvent ( QEvent event)

Reimplemented from QObject::event().

new void QtCore.QVariantAnimation.OnValueChanged ( object  value)
protected

QVariantAnimation emits this signal whenever the current value changes.

See also currentValue, startValue, and endValue.

new void QtCore.QVariantAnimation.SetDuration ( int  msecs)
new void QtCore.QVariantAnimation.SetKeyValueAt ( double  step,
object  value 
)

Creates a key frame at the given step with the given value. The given step must be in the range 0 to 1.

See also setKeyValues() and keyValueAt().

static string QtCore.QVariantAnimation.Tr ( string  s,
string  c = null 
)
static
static string QtCore.QVariantAnimation.Tr ( string  s,
string  c,
int  n 
)
static
static string QtCore.QVariantAnimation.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtCore.QVariantAnimation.TrUtf8 ( string  s,
string  c,
int  n 
)
static
override void QtCore.QVariantAnimation.UpdateCurrentTime ( int  arg1)
protectedvirtual

Reimplemented from QAbstractAnimation::updateCurrentTime().

Implements QtCore.QAbstractAnimation.

abstract void QtCore.QVariantAnimation.UpdateCurrentValue ( object  value)
protectedpure virtual

This pure virtual function is called every time the animation's current value changes. The value argument is the new current value.

See also currentValue.

Implemented in QtCore.QPropertyAnimation.

override void QtCore.QVariantAnimation.UpdateState ( QAbstractAnimation.State  newState,
QAbstractAnimation.State  oldState 
)
protectedvirtual

Reimplemented from QAbstractAnimation::updateState().

Reimplemented from QtCore.QAbstractAnimation.

Property Documentation

new object QtCore.QVariantAnimation.CurrentValue
get

This property holds the current value of the animation.

This property describes the current value; an interpolated value between the start value and the end value, using the current time for progress. The value itself is obtained from interpolated(), which is called repeatedly as the animation is running.

QVariantAnimation calls the virtual updateCurrentValue() function when the current value changes. This is particularly useful for subclasses that need to track updates. For example, QPropertyAnimation uses this function to animate Qt properties.

new QEasingCurve QtCore.QVariantAnimation.EasingCurve
getset

This property holds the easing curve of the animation.

This property defines the easing curve of the animation. By default, a linear easing curve is used, resulting in linear interpolation. Other curves are provided, for instance, QEasingCurve::InCirc, which provides a circular entry curve. Another example is QEasingCurve::InOutElastic, which provides an elastic effect on the values of the interpolated variant.

QVariantAnimation will use the QEasingCurve::valueForProgress() to transform the "normalized progress" (currentTime / totalDuration) of the animation into the effective progress actually used by the animation. It is this effective progress that will be the progress when interpolated() is called. Also, the steps in the keyValues are referring to this effective progress.

The easing curve is used with the interpolator, the interpolated() virtual function, the animation's duration, and iterationCount, to control how the current value changes as the animation progresses.

new IQVariantAnimationSignals QtCore.QVariantAnimation.Emit
getprotected
new object QtCore.QVariantAnimation.EndValue
getset

This property holds the end value of the animation.

This property describes the end value of the animation.

new object QtCore.QVariantAnimation.StartValue
getset

This property holds the optional start value of the animation.

This property describes the optional start value of the animation. If omitted, or if a null QVariant is assigned as the start value, the animation will use the current position of the end when the animation is started.

new QMetaObject QtCore.QVariantAnimation.StaticMetaObject
staticget
Slot<System.Object> QtCore.QVariantAnimation.ValueChanged
addremove

QVariantAnimation emits this signal whenever the current value changes.

See also currentValue, startValue, and endValue.