Qt 4.8
qdeclarativetimeline.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "private/qdeclarativetimeline_p_p.h"
43 
44 #include <QDebug>
45 #include <QMutex>
46 #include <QThread>
47 #include <QWaitCondition>
48 #include <QEvent>
49 #include <QCoreApplication>
50 #include <QEasingCurve>
51 #include <QTime>
52 
54 
55 struct Update {
57  : g(_g), v(_v) {}
59  : g(0), v(0), e(_e) {}
60 
64 };
65 
67 {
69 
70  struct Op {
71  enum Type {
73  Set,
78  Execute
79  };
80  Op() {}
81  Op(Type t, int l, qreal v, qreal v2, int o,
83  : type(t), length(l), value(v), value2(v2), order(o), event(ev),
84  easing(es) {}
85  Op(const Op &o)
86  : type(o.type), length(o.length), value(o.value), value2(o.value2),
87  order(o.order), event(o.event), easing(o.easing) {}
88  Op &operator=(const Op &o) {
89  type = o.type; length = o.length; value = o.value;
90  value2 = o.value2; order = o.order; event = o.event;
91  easing = o.easing;
92  return *this;
93  }
94 
96  int length;
99 
100  int order;
103  };
104  struct TimeLine
105  {
106  TimeLine() : length(0), consumedOpLength(0), base(0.) {}
108  int length;
111  };
112 
113  int length;
116  Ops ops;
118 
119  void add(QDeclarativeTimeLineObject &, const Op &);
120  qreal value(const Op &op, int time, qreal base, bool *) const;
121 
122  int advance(int);
123 
125  int prevTime;
126 
127  int order;
128 
130  int syncAdj;
132 };
133 
135 : length(0), syncPoint(0), q(parent), clockRunning(false), prevTime(0), order(0), syncMode(QDeclarativeTimeLine::LocalSync), syncAdj(0), updateQueue(0)
136 {
137 }
138 
140 {
141  if (g._t && g._t != q) {
142  qWarning() << "QDeclarativeTimeLine: Cannot modify a QDeclarativeTimeLineValue owned by"
143  << "another timeline.";
144  return;
145  }
146  g._t = q;
147 
148  Ops::Iterator iter = ops.find(&g);
149  if (iter == ops.end()) {
150  iter = ops.insert(&g, TimeLine());
151  if (syncPoint > 0)
152  q->pause(g, syncPoint);
153  }
154  if (!iter->ops.isEmpty() &&
155  o.type == Op::Pause &&
156  iter->ops.last().type == Op::Pause) {
157  iter->ops.last().length += o.length;
158  iter->length += o.length;
159  } else {
160  iter->ops.append(o);
161  iter->length += o.length;
162  }
163 
164  if (iter->length > length)
165  length = iter->length;
166 
167  if (!clockRunning) {
168  q->stop();
169  prevTime = 0;
170  clockRunning = true;
171 
173  syncAdj = -1;
174  } else {
175  syncAdj = 0;
176  }
177  q->start();
178 /* q->tick(0);
179  if (syncMode == QDeclarativeTimeLine::LocalSync) {
180  syncAdj = -1;
181  } else {
182  syncAdj = 0;
183  }
184  */
185  }
186 }
187 
188 qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, bool *changed) const
189 {
190  Q_ASSERT(time >= 0);
191  Q_ASSERT(time <= op.length);
192  *changed = true;
193 
194  switch(op.type) {
195  case Op::Pause:
196  *changed = false;
197  return base;
198  case Op::Set:
199  return op.value;
200  case Op::Move:
201  if (time == 0) {
202  return base;
203  } else if (time == (op.length)) {
204  return op.value;
205  } else {
206  qreal delta = op.value - base;
207  qreal pTime = (qreal)(time) / (qreal)op.length;
209  return base + delta * pTime;
210  else
211  return base + delta * op.easing.valueForProgress(pTime);
212  }
213  case Op::MoveBy:
214  if (time == 0) {
215  return base;
216  } else if (time == (op.length)) {
217  return base + op.value;
218  } else {
219  qreal delta = op.value;
220  qreal pTime = (qreal)(time) / (qreal)op.length;
222  return base + delta * pTime;
223  else
224  return base + delta * op.easing.valueForProgress(pTime);
225  }
226  case Op::Accel:
227  if (time == 0) {
228  return base;
229  } else {
230  qreal t = (qreal)(time) / 1000.0f;
231  qreal delta = op.value * t + 0.5f * op.value2 * t * t;
232  return base + delta;
233  }
234  case Op::AccelDistance:
235  if (time == 0) {
236  return base;
237  } else if (time == (op.length)) {
238  return base + op.value2;
239  } else {
240  qreal t = (qreal)(time) / 1000.0f;
241  qreal accel = -1.0f * 1000.0f * op.value / (qreal)op.length;
242  qreal delta = op.value * t + 0.5f * accel * t * t;
243  return base + delta;
244 
245  }
246  case Op::Execute:
247  op.event.d0(op.event.d1);
248  *changed = false;
249  return -1;
250  }
251 
252  return base;
253 }
254 
317 : QAbstractAnimation(parent)
318 {
319  d = new QDeclarativeTimeLinePrivate(this);
320 }
321 
327 {
329  iter != d->ops.end();
330  ++iter)
331  iter.key()->_t = 0;
332 
333  delete d; d = 0;
334 }
335 
344 {
345  return d->syncMode;
346 }
347 
352 {
353  d->syncMode = syncMode;
354 }
355 
360 {
361  if (time <= 0) return;
363  d->add(obj, op);
364 }
365 
370 {
372  d->add(*callback.callbackObject(), op);
373 }
374 
379 {
381  d->add(timeLineValue, op);
382 }
383 
390 int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration)
391 {
392  if (acceleration == 0.0f)
393  return -1;
394 
395  if ((velocity > 0.0f) == (acceleration > 0.0f))
396  acceleration = acceleration * -1.0f;
397 
398  int time = static_cast<int>(-1000 * velocity / acceleration);
399 
401  d->add(timeLineValue, op);
402 
403  return time;
404 }
405 
419 int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration, qreal maxDistance)
420 {
421  if (maxDistance == 0.0f || acceleration == 0.0f)
422  return -1;
423 
424  Q_ASSERT(acceleration > 0.0f && maxDistance > 0.0f);
425 
426  qreal maxAccel = (velocity * velocity) / (2.0f * maxDistance);
427  if (maxAccel > acceleration)
428  acceleration = maxAccel;
429 
430  if ((velocity > 0.0f) == (acceleration > 0.0f))
431  acceleration = acceleration * -1.0f;
432 
433  int time = static_cast<int>(-1000 * velocity / acceleration);
434 
436  d->add(timeLineValue, op);
437 
438  return time;
439 }
440 
449 {
450  if (distance == 0.0f || velocity == 0.0f)
451  return -1;
452 
453  Q_ASSERT((distance >= 0.0f) == (velocity >= 0.0f));
454 
455  int time = static_cast<int>(1000 * (2.0f * distance) / velocity);
456 
458  d->add(timeLineValue, op);
459 
460  return time;
461 }
462 
467 void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal destination, int time)
468 {
469  if (time <= 0) return;
471  d->add(timeLineValue, op);
472 }
473 
478 void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal destination, const QEasingCurve &easing, int time)
479 {
480  if (time <= 0) return;
482  d->add(timeLineValue, op);
483 }
484 
490 {
491  if (time <= 0) return;
493  d->add(timeLineValue, op);
494 }
495 
500 void QDeclarativeTimeLine::moveBy(QDeclarativeTimeLineValue &timeLineValue, qreal change, const QEasingCurve &easing, int time)
501 {
502  if (time <= 0) return;
504  d->add(timeLineValue, op);
505 }
506 
511 {
512  if (!timeLineValue._t)
513  return;
514  if (timeLineValue._t != this) {
515  qWarning() << "QDeclarativeTimeLine: Cannot reset a QDeclarativeTimeLineValue owned by another timeline.";
516  return;
517  }
518  remove(&timeLineValue);
519  timeLineValue._t = 0;
520 }
521 
523 {
524  return -1;
525 }
526 
539 {
541  if (iter == d->ops.end())
542  return;
543  int length = iter->length;
544 
545  iter = d->ops.find(&timeLineValue);
546  if (iter == d->ops.end()) {
547  pause(timeLineValue, length);
548  } else {
549  int glength = iter->length;
550  pause(timeLineValue, length - glength);
551  }
552 }
553 
564 {
565  QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(&timeLineValue);
566  if (iter == d->ops.end()) {
567  pause(timeLineValue, d->length);
568  } else {
569  pause(timeLineValue, d->length - iter->length);
570  }
571 }
572 
573 /*
574  Synchronize all currently and future scheduled values in this timeline to
575  the longest action currently scheduled.
576 
577  For example:
578  \code
579  value1->setValue(0.);
580  value2->setValue(0.);
581  value3->setValue(0.);
582  QDeclarativeTimeLine tl;
583  ...
584  tl.move(value1, 10, 200);
585  tl.move(value2, 10, 100);
586  tl.sync();
587  tl.move(value2, 20, 100);
588  tl.move(value3, 20, 100);
589  \endcode
590 
591  will result in:
592 
593  \table
594  \header <td> <td> 0ms <td> 50ms <td> 100ms <td> 150ms <td> 200ms <td> 250ms <td> 300ms
595  \row <td> value1 <td> 0 <td> 2.5 <td> 5.0 <td> 7.5 <td> 10 <td> 10 <td> 10
596  \row <td> value2 <td> 0 <td> 5.0 <td> 10.0 <td> 10.0 <td> 10.0 <td> 15.0 <td> 20.0
597  \row <td> value2 <td> 0 <td> 0 <td> 0 <td> 0 <td> 0 <td> 10.0 <td> 20.0
598  \endtable
599 */
600 
601 /*void QDeclarativeTimeLine::sync()
602 {
603  for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin();
604  iter != d->ops.end();
605  ++iter)
606  pause(*iter.key(), d->length - iter->length);
607  d->syncPoint = d->length;
608 }*/
609 
619 {
620  d->syncPoint = sp;
621 }
622 
632 {
633  return d->syncPoint;
634 }
635 
641 {
642  return !d->ops.isEmpty();
643 }
644 
658 {
659  d->advance(d->length);
660 }
661 
675 {
676  for (QDeclarativeTimeLinePrivate::Ops::ConstIterator iter = d->ops.begin(); iter != d->ops.end(); ++iter)
677  iter.key()->_t = 0;
678  d->ops.clear();
679  d->length = 0;
680  d->syncPoint = 0;
681  //XXX need stop here?
682 }
683 
685 {
686  return d->prevTime;
687 }
688 
700 {
701  if (d->syncAdj == -1)
702  d->syncAdj = v;
703  v -= d->syncAdj;
704 
705  int timeChanged = v - d->prevTime;
706 #if 0
707  if (!timeChanged)
708  return;
709 #endif
710  d->prevTime = v;
711  d->advance(timeChanged);
712  emit updated();
713 
714  // Do we need to stop the clock?
715  if (d->ops.isEmpty()) {
716  stop();
717  d->prevTime = 0;
718  d->clockRunning = false;
719  emit completed();
720  } /*else if (pauseTime > 0) {
721  GfxClock::cancelClock();
722  d->prevTime = 0;
723  GfxClock::pauseFor(pauseTime);
724  d->syncAdj = 0;
725  d->clockRunning = false;
726  }*/ else if ( state() != Running) {
727  stop();
728  d->prevTime = 0;
729  d->clockRunning = true;
730  d->syncAdj = 0;
731  start();
732  }
733 }
734 
735 bool operator<(const QPair<int, Update> &lhs,
736  const QPair<int, Update> &rhs)
737 {
738  return lhs.first < rhs.first;
739 }
740 
742 {
743  int pauseTime = -1;
744 
745  // XXX - surely there is a more efficient way?
746  do {
747  pauseTime = -1;
748  // Minimal advance time
749  int advanceTime = t;
750  for (Ops::Iterator iter = ops.begin(); iter != ops.end(); ++iter) {
751  TimeLine &tl = *iter;
752  Op &op = tl.ops.first();
753  int length = op.length - tl.consumedOpLength;
754 
755  if (length < advanceTime) {
756  advanceTime = length;
757  if (advanceTime == 0)
758  break;
759  }
760  }
761  t -= advanceTime;
762 
763  // Process until then. A zero length advance time will only process
764  // sets.
765  QList<QPair<int, Update> > updates;
766 
767  for (Ops::Iterator iter = ops.begin(); iter != ops.end(); ) {
768  QDeclarativeTimeLineValue *v = static_cast<QDeclarativeTimeLineValue *>(iter.key());
769  TimeLine &tl = *iter;
770  Q_ASSERT(!tl.ops.isEmpty());
771 
772  do {
773  Op &op = tl.ops.first();
774  if (advanceTime == 0 && op.length != 0)
775  continue;
776 
777  if (tl.consumedOpLength == 0 &&
778  op.type != Op::Pause &&
779  op.type != Op::Execute)
780  tl.base = v->value();
781 
782  if ((tl.consumedOpLength + advanceTime) == op.length) {
783  if (op.type == Op::Execute) {
784  updates << qMakePair(op.order, Update(op.event));
785  } else {
786  bool changed = false;
787  qreal val = value(op, op.length, tl.base, &changed);
788  if (changed)
789  updates << qMakePair(op.order, Update(v, val));
790  }
791  tl.length -= qMin(advanceTime, tl.length);
792  tl.consumedOpLength = 0;
793  tl.ops.removeFirst();
794  } else {
795  tl.consumedOpLength += advanceTime;
796  bool changed = false;
797  qreal val = value(op, tl.consumedOpLength, tl.base, &changed);
798  if (changed)
799  updates << qMakePair(op.order, Update(v, val));
800  tl.length -= qMin(advanceTime, tl.length);
801  break;
802  }
803 
804  } while(!tl.ops.isEmpty() && advanceTime == 0 && tl.ops.first().length == 0);
805 
806 
807  if (tl.ops.isEmpty()) {
808  iter = ops.erase(iter);
809  v->_t = 0;
810  } else {
811  if (tl.ops.first().type == Op::Pause && pauseTime != 0) {
812  int opPauseTime = tl.ops.first().length - tl.consumedOpLength;
813  if (pauseTime == -1 || opPauseTime < pauseTime)
814  pauseTime = opPauseTime;
815  } else {
816  pauseTime = 0;
817  }
818  ++iter;
819  }
820  }
821 
822  length -= qMin(length, advanceTime);
823  syncPoint -= advanceTime;
824 
825  qSort(updates.begin(), updates.end());
826  updateQueue = &updates;
827  for (int ii = 0; ii < updates.count(); ++ii) {
828  const Update &v = updates.at(ii).second;
829  if (v.g) {
830  v.g->setValue(v.v);
831  } else {
832  v.e.d0(v.e.d1);
833  }
834  }
835  updateQueue = 0;
836  } while(t);
837 
838  return pauseTime;
839 }
840 
842 {
844  Q_ASSERT(iter != d->ops.end());
845 
846  int len = iter->length;
847  d->ops.erase(iter);
848  if (len == d->length) {
849  // We need to recalculate the length
850  d->length = 0;
852  iter != d->ops.end();
853  ++iter) {
854 
855  if (iter->length > d->length)
856  d->length = iter->length;
857 
858  }
859  }
860  if (d->ops.isEmpty()) {
861  stop();
862  d->clockRunning = false;
863  } else if ( state() != Running) {
864  stop();
865  d->prevTime = 0;
866  d->clockRunning = true;
867 
869  d->syncAdj = -1;
870  } else {
871  d->syncAdj = 0;
872  }
873  start();
874  }
875 
876  if (d->updateQueue) {
877  for (int ii = 0; ii < d->updateQueue->count(); ++ii) {
878  if (d->updateQueue->at(ii).second.g == v ||
879  d->updateQueue->at(ii).second.e.callbackObject() == v) {
880  d->updateQueue->removeAt(ii);
881  --ii;
882  }
883  }
884  }
885 
886 
887 }
888 
934 : _t(0)
935 {
936 }
937 
939 {
940  if (_t) {
941  _t->remove(this);
942  _t = 0;
943  }
944 }
945 
947 : d0(0), d1(0), d2(0)
948 {
949 }
950 
952 : d0(f), d1(d), d2(b)
953 {
954 }
955 
957 : d0(o.d0), d1(o.d1), d2(o.d2)
958 {
959 }
960 
962 {
963  d0 = o.d0;
964  d1 = o.d1;
965  d2 = o.d2;
966  return *this;
967 }
968 
970 {
971  return d2;
972 }
973 
double d
Definition: qnumeric_p.h:62
~QDeclarativeTimeLine()
Destroys the time line.
QDeclarativeTimeLineObject * d2
int accelDistance(QDeclarativeTimeLineValue &, qreal velocity, qreal distance)
Decelerate timeLineValue from the starting velocity to zero over the given distance.
virtual IFMETHOD Pause(DWORD __RPC_FAR *pdwCookie)=0
friend struct QDeclarativeTimeLinePrivate
int type
Definition: qmetatype.cpp:239
qreal valueForProgress(qreal progress) const
Return the effective progress for the easing curve at progress.
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
int syncPoint() const
Temporary hack.
EventRef event
void clear()
Removes all items from the hash.
Definition: qhash.h:574
The QEasingCurve class provides easing curves for controlling animation.
Definition: qeasingcurve.h:55
#define add(aName)
QDeclarativeTimeLineCallback & operator=(const QDeclarativeTimeLineCallback &o)
int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel)
Decelerate timeLineValue from the starting velocity to zero at the given acceleration rate...
Op(Type t, int l, qreal v, qreal v2, int o, const QDeclarativeTimeLineCallback &ev=QDeclarativeTimeLineCallback(), const QEasingCurve &es=QEasingCurve())
QDeclarativeTimeLine::SyncMode syncMode
void setSyncPoint(int)
Temporary hack.
State state() const
void move(QDeclarativeTimeLineValue &, qreal destination, int time=500)
Linearly change the timeLineValue from its current value to the given destination value over time mil...
void setSyncMode(SyncMode)
Set the timeline&#39;s synchronization mode to syncMode.
const_iterator ConstIterator
Qt-style synonym for QHash::const_iterator.
Definition: qhash.h:474
T1 first
Definition: qpair.h:65
QHash< QDeclarativeTimeLineObject *, TimeLine > Ops
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
QDeclarativeTimeLine(QObject *parent=0)
Construct a new QDeclarativeTimeLine with the specified parent.
void start(QAbstractAnimation::DeletionPolicy policy=KeepWhenStopped)
Starts the animation.
void reset(QDeclarativeTimeLineValue &)
Cancel (but don&#39;t complete) all scheduled actions for timeLineValue.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void remove(QDeclarativeTimeLineObject *)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
virtual void updateCurrentTime(int)
This pure virtual function is called every time the animation&#39;s currentTime changes.
QDeclarativeTimeLineCallback e
static const uint base
Definition: qurl.cpp:268
virtual int duration() const
void stop()
Stops the animation.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
The QDeclarativeTimeLineValue class provides a value that can be modified by QDeclarativeTimeLine.
bool isActive() const
Returns true if the timeline is active.
void clear()
Resets the timeline.
Update(const QDeclarativeTimeLineCallback &_e)
QList< QPair< int, Update > > * updateQueue
Type type() const
Returns the type of the easing curve.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
Update(QDeclarativeTimeLineValue *_g, qreal _v)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:270
virtual qreal value() const
Return the current value.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
Q_CORE_EXPORT void qWarning(const char *,...)
void moveBy(QDeclarativeTimeLineValue &, qreal change, int time=500)
Linearly change the timeLineValue from its current value by the change amount over time milliseconds...
static int distance(QWidget *source, QWidget *target, QAccessible::RelationFlag relation)
The QAbstractAnimation class is the base of all animations.
void set(QDeclarativeTimeLineValue &, qreal)
Set the value of timeLineValue.
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
SyncMode syncMode() const
Return the timeline&#39;s synchronization mode.
void pause(QDeclarativeTimeLineObject &, int)
Pause obj for time milliseconds.
void updated()
Emitted each time the timeline modifies QDeclarativeTimeLineValues.
QDeclarativeTimeLinePrivate * d
void complete()
Completes the timeline.
QDeclarativeTimeLineObject * callbackObject() const
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
Definition: qpair.h:102
if(void) toggleToolbarShown
The QDeclarativeTimeLine class provides a timeline for controlling animations.
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
QFactoryLoader * l
void pause()
Pauses the animation.
void add(QDeclarativeTimeLineObject &, const Op &)
qreal value(const Op &op, int time, qreal base, bool *) const
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865
QDeclarativeTimeLineValue * g
virtual void setValue(qreal v)
Set the current value.
QDeclarativeTimeLineCallback event
void callback(const QDeclarativeTimeLineCallback &)
Execute the event.
iterator erase(iterator it)
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator...
Definition: qhash.h:827
QDeclarativeTimeLinePrivate(QDeclarativeTimeLine *)
iterator Iterator
Qt-style synonym for QHash::iterator.
Definition: qhash.h:473
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480