Qt 4.8
Signals | Public Functions | Protected Functions | Properties | List of all members
QDeclarativePropertyAction Class Reference

#include <qdeclarativeanimation_p.h>

Inheritance diagram for QDeclarativePropertyAction:
QDeclarativeAbstractAnimation QObject QDeclarativePropertyValueSource QDeclarativeParserStatus

Signals

void propertiesChanged (const QString &)
 
void propertyChanged ()
 
void targetChanged ()
 
void valueChanged (const QVariant &)
 
- Signals inherited from QDeclarativeAbstractAnimation
void alwaysRunToEndChanged (bool)
 
void completed ()
 
void loopCountChanged (int)
 
void pausedChanged (bool)
 
void runningChanged (bool)
 
void started ()
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

QDeclarativeListProperty< QObjectexclude ()
 
QString properties () const
 
QString property () const
 
 QDeclarativePropertyAction (QObject *parent=0)
 
void setProperties (const QString &)
 
void setProperty (const QString &)
 
void setTarget (QObject *)
 
void setValue (const QVariant &)
 
QObjecttarget () const
 
QDeclarativeListProperty< QObjecttargets ()
 
QVariant value () const
 
virtual ~QDeclarativePropertyAction ()
 
- Public Functions inherited from QDeclarativeAbstractAnimation
bool alwaysRunToEnd () const
 
void classBegin ()
 Invoked after class creation, but before any properties have been set. More...
 
void componentComplete ()
 Invoked after the root component that caused this instantiation has completed construction. More...
 
int currentTime ()
 
QDeclarativeAnimationGroupgroup () const
 
bool isPaused () const
 
bool isRunning () const
 
int loops () const
 
 QDeclarativeAbstractAnimation (QObject *parent=0)
 
void setAlwaysRunToEnd (bool)
 
void setCurrentTime (int)
 
void setDefaultTarget (const QDeclarativeProperty &)
 
void setDisableUserControl ()
 
void setGroup (QDeclarativeAnimationGroup *)
 
void setLoops (int)
 
void setPaused (bool)
 
void setRunning (bool)
 
virtual ~QDeclarativeAbstractAnimation ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) 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. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
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. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QDeclarativePropertyValueSource
 QDeclarativePropertyValueSource ()
 Constructs a QDeclarativePropertyValueSource. More...
 
virtual ~QDeclarativePropertyValueSource ()
 Destroys the value source. More...
 
- Public Functions inherited from QDeclarativeParserStatus
 QDeclarativeParserStatus ()
 
virtual ~QDeclarativeParserStatus ()
 

Protected Functions

virtual QAbstractAnimationqtAnimation ()
 
virtual void transition (QDeclarativeStateActions &actions, QDeclarativeProperties &modified, TransitionDirection direction)
 
- Protected Functions inherited from QDeclarativeAbstractAnimation
 QDeclarativeAbstractAnimation (QDeclarativeAbstractAnimationPrivate &dd, QObject *parent)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 

Properties

QDeclarativeListProperty< QObjectexclude
 
QString properties
 
QString property
 
QObjecttarget
 
QDeclarativeListProperty< QObjecttargets
 
QVariant value
 

Additional Inherited Members

- Public Types inherited from QDeclarativeAbstractAnimation
enum  Loops { Infinite = -2 }
 
enum  TransitionDirection { Forward, Backward }
 
- Public Slots inherited from QDeclarativeAbstractAnimation
void complete ()
 
void pause ()
 
void restart ()
 
void resume ()
 
void start ()
 
void stop ()
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 194 of file qdeclarativeanimation_p.h.

Constructors and Destructors

◆ QDeclarativePropertyAction()

QDeclarativePropertyAction::QDeclarativePropertyAction ( QObject parent = 0)

◆ ~QDeclarativePropertyAction()

QDeclarativePropertyAction::~QDeclarativePropertyAction ( )
virtual

Definition at line 971 of file qdeclarativeanimation.cpp.

972 {
973 }

Functions

◆ exclude()

QDeclarativeListProperty<QObject> QDeclarativePropertyAction::exclude ( )

Referenced by setProperties().

◆ properties()

QString QDeclarativePropertyAction::properties ( ) const

Referenced by setProperty().

◆ propertiesChanged

void QDeclarativePropertyAction::propertiesChanged ( const QString )
signal

Referenced by setProperties().

◆ property()

QString QDeclarativePropertyAction::property ( ) const

Referenced by setTarget().

◆ propertyChanged

void QDeclarativePropertyAction::propertyChanged ( )
signal

Referenced by setProperty().

◆ qtAnimation()

QAbstractAnimation * QDeclarativePropertyAction::qtAnimation ( )
protectedvirtual

Implements QDeclarativeAbstractAnimation.

Definition at line 1093 of file qdeclarativeanimation.cpp.

1094 {
1096  return d->spa;
1097 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setProperties()

void QDeclarativePropertyAction::setProperties ( const QString p)

Definition at line 1036 of file qdeclarativeanimation.cpp.

1037 {
1039  if (d->properties == p)
1040  return;
1041  d->properties = p;
1043 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void propertiesChanged(const QString &)
#define emit
Definition: qobjectdefs.h:76

◆ setProperty()

void QDeclarativePropertyAction::setProperty ( const QString n)

Definition at line 1003 of file qdeclarativeanimation.cpp.

1004 {
1006  if (d->propertyName == n)
1007  return;
1008  d->propertyName = n;
1010 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setTarget()

void QDeclarativePropertyAction::setTarget ( QObject o)

Definition at line 988 of file qdeclarativeanimation.cpp.

989 {
991  if (d->target == o)
992  return;
993  d->target = o;
995 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setValue()

void QDeclarativePropertyAction::setValue ( const QVariant v)

Definition at line 1084 of file qdeclarativeanimation.cpp.

1085 {
1087  if (d->value.isNull || d->value != v) {
1088  d->value = v;
1089  emit valueChanged(v);
1090  }
1091 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void valueChanged(const QVariant &)

◆ target()

QObject* QDeclarativePropertyAction::target ( ) const

◆ targetChanged

void QDeclarativePropertyAction::targetChanged ( )
signal

Referenced by setTarget().

◆ targets()

QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets ( )

Referenced by setProperties(), and transition().

◆ transition()

void QDeclarativePropertyAction::transition ( QDeclarativeStateActions actions,
QDeclarativeProperties modified,
TransitionDirection  direction 
)
protectedvirtual

Reimplemented from QDeclarativeAbstractAnimation.

Definition at line 1099 of file qdeclarativeanimation.cpp.

1102 {
1105 
1106  struct QDeclarativeSetPropertyAnimationAction : public QAbstractAnimationAction
1107  {
1108  QDeclarativeStateActions actions;
1109  virtual void doAction()
1110  {
1111  for (int ii = 0; ii < actions.count(); ++ii) {
1112  const QDeclarativeAction &action = actions.at(ii);
1114  }
1115  }
1116  };
1117 
1118  QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(','));
1119  for (int ii = 0; ii < props.count(); ++ii)
1120  props[ii] = props.at(ii).trimmed();
1121  if (!d->propertyName.isEmpty())
1122  props << d->propertyName;
1123 
1124  QList<QObject*> targets = d->targets;
1125  if (d->target)
1126  targets.append(d->target);
1127 
1128  bool hasSelectors = !props.isEmpty() || !targets.isEmpty() || !d->exclude.isEmpty();
1129 
1130  if (d->defaultProperty.isValid() && !hasSelectors) {
1131  props << d->defaultProperty.name();
1132  targets << d->defaultProperty.object();
1133  }
1134 
1135  QDeclarativeSetPropertyAnimationAction *data = new QDeclarativeSetPropertyAnimationAction;
1136 
1137  bool hasExplicit = false;
1138  //an explicit animation has been specified
1139  if (d->value.isValid()) {
1140  for (int i = 0; i < props.count(); ++i) {
1141  for (int j = 0; j < targets.count(); ++j) {
1142  QDeclarativeAction myAction;
1143  myAction.property = d->createProperty(targets.at(j), props.at(i), this);
1144  if (myAction.property.isValid()) {
1145  myAction.toValue = d->value;
1147  data->actions << myAction;
1148  hasExplicit = true;
1149  for (int ii = 0; ii < actions.count(); ++ii) {
1150  QDeclarativeAction &action = actions[ii];
1151  if (action.property.object() == myAction.property.object() &&
1152  myAction.property.name() == action.property.name()) {
1153  modified << action.property;
1154  break; //### any chance there could be multiples?
1155  }
1156  }
1157  }
1158  }
1159  }
1160  }
1161 
1162  if (!hasExplicit)
1163  for (int ii = 0; ii < actions.count(); ++ii) {
1164  QDeclarativeAction &action = actions[ii];
1165 
1166  QObject *obj = action.property.object();
1167  QString propertyName = action.property.name();
1168  QObject *sObj = action.specifiedObject;
1169  QString sPropertyName = action.specifiedProperty;
1170  bool same = (obj == sObj);
1171 
1172  if ((targets.isEmpty() || targets.contains(obj) || (!same && targets.contains(sObj))) &&
1173  (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
1174  (props.contains(propertyName) || (!same && props.contains(sPropertyName)))) {
1175  QDeclarativeAction myAction = action;
1176 
1177  if (d->value.isValid())
1178  myAction.toValue = d->value;
1180 
1181  modified << action.property;
1182  data->actions << myAction;
1183  action.fromValue = myAction.toValue;
1184  }
1185  }
1186 
1187  if (data->actions.count()) {
1188  d->spa->setAnimAction(data, QAbstractAnimation::DeleteWhenStopped);
1189  } else {
1190  delete data;
1191  }
1192 }
QDeclarativeProperty property
QDeclarativeParserStatus ** d
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString properties() const
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_D(Class)
Definition: qglobal.h:2482
bool isValid() const
Returns true if the QDeclarativeProperty refers to a valid property, otherwise false.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QDeclarativeListProperty< QObject > targets()
QObject * object() const
Returns the QDeclarativeProperty&#39;s QObject.
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
Definition: qstring.cpp:4506
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
static const char * data(const QByteArray &arr)
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
static void split(QT_FT_Vector *b)
int propertyType() const
Returns the QVariant type of the property, or QVariant::Invalid if the property has no QVariant type...
if(void) toggleToolbarShown
QString name() const
Return the name of this QML property.
static void convertVariant(QVariant &variant, int type)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
static bool write(QObject *, const QDeclarativePropertyCache::Data &, const QVariant &, QDeclarativeContextData *, WriteFlags flags=0)
Qt::LayoutDirection direction

◆ value()

QVariant QDeclarativePropertyAction::value ( ) const

Referenced by setProperties().

◆ valueChanged

void QDeclarativePropertyAction::valueChanged ( const QVariant )
signal

Referenced by setValue().

Properties

◆ exclude

QDeclarativeListProperty< QObject > QDeclarativePropertyAction::exclude
private

Definition at line 203 of file qdeclarativeanimation_p.h.

◆ properties

QString QDeclarativePropertyAction::properties
private

Definition at line 201 of file qdeclarativeanimation_p.h.

◆ property

QString QDeclarativePropertyAction::property
private

Definition at line 200 of file qdeclarativeanimation_p.h.

◆ target

QObject * QDeclarativePropertyAction::target
private

Definition at line 199 of file qdeclarativeanimation_p.h.

◆ targets

QDeclarativeListProperty< QObject > QDeclarativePropertyAction::targets
private

Definition at line 202 of file qdeclarativeanimation_p.h.

◆ value

QVariant QDeclarativePropertyAction::value
private

Definition at line 204 of file qdeclarativeanimation_p.h.


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