本文整理汇总了C++中QAbstractAnimation::loopCount方法的典型用法代码示例。如果您正苦于以下问题:C++ QAbstractAnimation::loopCount方法的具体用法?C++ QAbstractAnimation::loopCount怎么用?C++ QAbstractAnimation::loopCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAbstractAnimation
的用法示例。
在下文中一共展示了QAbstractAnimation::loopCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _q_uncontrolledAnimationFinished
void QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished()
{
Q_Q(QParallelAnimationGroup);
QAbstractAnimation *animation = qobject_cast<QAbstractAnimation *>(q->sender());
Q_ASSERT(animation);
int uncontrolledRunningCount = 0;
if (animation->duration() == -1 || animation->loopCount() < 0) {
QHash<QAbstractAnimation *, int>::iterator it = uncontrolledFinishTime.begin();
while (it != uncontrolledFinishTime.end()) {
if (it.key() == animation) {
*it = animation->currentTime();
}
if (it.value() == -1)
++uncontrolledRunningCount;
++it;
}
}
if (uncontrolledRunningCount > 0)
return;
int maxDuration = 0;
for (int i = 0; i < animations.size(); ++i)
maxDuration = qMax(maxDuration, animations.at(i)->totalDuration());
if (currentTime >= maxDuration)
q->stop();
}
示例2: connectUncontrolledAnimations
void QParallelAnimationGroupPrivate::connectUncontrolledAnimations()
{
for (int i = 0; i < animations.size(); ++i) {
QAbstractAnimation *animation = animations.at(i);
if (animation->duration() == -1 || animation->loopCount() < 0) {
uncontrolledFinishTime[animation] = -1;
connectUncontrolledAnimation(animation);
}
}
}
示例3: connectUncontrolledAnimations
void QParallelAnimationGroupPrivate::connectUncontrolledAnimations()
{
Q_Q(QParallelAnimationGroup);
for (int i = 0; i < animations.size(); ++i) {
QAbstractAnimation *animation = animations.at(i);
if (animation->duration() == -1 || animation->loopCount() < 0) {
uncontrolledFinishTime[animation] = -1;
QObject::connect(animation, SIGNAL(finished()), q, SLOT(_q_uncontrolledAnimationFinished()));
}
}
}