Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QAbstractAnimationPrivate Class Reference

#include <qabstractanimation_p.h>

Inheritance diagram for QAbstractAnimationPrivate:
QObjectPrivate QObjectData QAnimationGroupPrivate QPauseAnimationPrivate QVariantAnimationPrivate QParallelAnimationGroupPrivate QSequentialAnimationGroupPrivate QPropertyAnimationPrivate

Public Functions

 QAbstractAnimationPrivate ()
 
void setState (QAbstractAnimation::State state)
 
virtual ~QAbstractAnimationPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static QAbstractAnimationPrivateget (QAbstractAnimation *q)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

int currentLoop
 
int currentTime
 
bool deleteWhenStopped
 
QAbstractAnimation::Direction direction
 
QAnimationGroupgroup
 
bool hasRegisteredTimer
 
bool isGroup
 
bool isPause
 
int loopCount
 
QAbstractAnimation::State state
 
int totalCurrentTime
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Detailed Description

Definition at line 73 of file qabstractanimation_p.h.

Constructors and Destructors

◆ QAbstractAnimationPrivate()

QAbstractAnimationPrivate::QAbstractAnimationPrivate ( )
inline

Definition at line 76 of file qabstractanimation_p.h.

◆ ~QAbstractAnimationPrivate()

virtual QAbstractAnimationPrivate::~QAbstractAnimationPrivate ( )
inlinevirtual

Definition at line 91 of file qabstractanimation_p.h.

91 {}

Functions

◆ get()

static QAbstractAnimationPrivate* QAbstractAnimationPrivate::get ( QAbstractAnimation q)
inlinestatic

◆ setState()

void QAbstractAnimationPrivate::setState ( QAbstractAnimation::State  state)

Definition at line 554 of file qabstractanimation.cpp.

555 {
557  if (state == newState)
558  return;
559 
560  if (loopCount == 0)
561  return;
562 
563  QAbstractAnimation::State oldState = state;
564  int oldCurrentTime = currentTime;
565  int oldCurrentLoop = currentLoop;
567 
568  // check if we should Rewind
569  if ((newState == QAbstractAnimation::Paused || newState == QAbstractAnimation::Running)
570  && oldState == QAbstractAnimation::Stopped) {
571  //here we reset the time if needed
572  //we don't call setCurrentTime because this might change the way the animation
573  //behaves: changing the state or changing the current value
575  0 : (loopCount == -1 ? q->duration() : q->totalDuration());
576  }
577 
578  state = newState;
580 
581  //(un)registration of the animation must always happen before calls to
582  //virtual function (updateState) to ensure a correct state of the timer
583  bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped;
584  if (oldState == QAbstractAnimation::Running) {
587  //the animation, is not running any more
589  } else if (newState == QAbstractAnimation::Running) {
590  QUnifiedTimer::registerAnimation(q, isTopLevel);
591  }
592 
593  q->updateState(newState, oldState);
594  if (!guard || newState != state) //this is to be safe if updateState changes the state
595  return;
596 
597  // Notify state change
598  emit q->stateChanged(newState, oldState);
599  if (!guard || newState != state) //this is to be safe if updateState changes the state
600  return;
601 
602  switch (state) {
604  break;
606  {
607 
608  // this ensures that the value is updated now that the animation is running
609  if (oldState == QAbstractAnimation::Stopped) {
610  if (isTopLevel) {
611  // currentTime needs to be updated if pauseTimer is active
613  q->setCurrentTime(totalCurrentTime);
614  }
615  }
616  }
617  break;
619  // Leave running state.
620  int dura = q->duration();
621 
622  if (deleteWhenStopped)
623  q->deleteLater();
624 
625  if (dura == -1 || loopCount < 0
626  || (oldDirection == QAbstractAnimation::Forward && (oldCurrentTime * (oldCurrentLoop + 1)) == (dura * loopCount))
627  || (oldDirection == QAbstractAnimation::Backward && oldCurrentTime == 0)) {
628  emit q->finished();
629  }
630  break;
631  }
632 }
State
This enum describes the state of the animation.
State state() const
static void registerAnimation(QAbstractAnimation *animation, bool isTopLevel)
QAbstractAnimation::Direction direction
#define Q_Q(Class)
Definition: qglobal.h:2483
QAbstractAnimation::State state
Direction
This enum describes the direction of the animation when in Running state.
#define emit
Definition: qobjectdefs.h:76
static void unregisterAnimation(QAbstractAnimation *animation)
The QAbstractAnimation class is the base of all animations.
static void ensureTimerUpdate()
The QWeakPointer class holds a weak reference to a shared pointer.

Properties

◆ currentLoop

int QAbstractAnimationPrivate::currentLoop

◆ currentTime

int QAbstractAnimationPrivate::currentTime

◆ deleteWhenStopped

bool QAbstractAnimationPrivate::deleteWhenStopped

Definition at line 107 of file qabstractanimation_p.h.

◆ direction

QAbstractAnimation::Direction QAbstractAnimationPrivate::direction

◆ group

QAnimationGroup* QAbstractAnimationPrivate::group

◆ hasRegisteredTimer

bool QAbstractAnimationPrivate::hasRegisteredTimer

◆ isGroup

bool QAbstractAnimationPrivate::isGroup

◆ isPause

bool QAbstractAnimationPrivate::isPause

◆ loopCount

int QAbstractAnimationPrivate::loopCount

◆ state

QAbstractAnimation::State QAbstractAnimationPrivate::state

Definition at line 98 of file qabstractanimation_p.h.

Referenced by QPropertyAnimationPrivate::updateProperty().

◆ totalCurrentTime

int QAbstractAnimationPrivate::totalCurrentTime

The documentation for this class was generated from the following files: