当前位置: 首页>>代码示例>>C++>>正文


C++ QAbstractAnimationJob::nextSibling方法代码示例

本文整理汇总了C++中QAbstractAnimationJob::nextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ QAbstractAnimationJob::nextSibling方法的具体用法?C++ QAbstractAnimationJob::nextSibling怎么用?C++ QAbstractAnimationJob::nextSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QAbstractAnimationJob的用法示例。


在下文中一共展示了QAbstractAnimationJob::nextSibling方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateState

void QContinuingAnimationGroupJob::updateState(QAbstractAnimationJob::State newState,
                                          QAbstractAnimationJob::State oldState)
{
    QAnimationGroupJob::updateState(newState, oldState);

    switch (newState) {
    case Stopped:
        for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
            animation->stop();
        break;
    case Paused:
        for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
            if (animation->isRunning())
                animation->pause();
        break;
    case Running:
        if (!firstChild()) {
            stop();
            return;
        }
        for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
            resetUncontrolledAnimationFinishTime(animation);
            animation->setDirection(m_direction);
            animation->start();
        }
        break;
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:28,代码来源:qcontinuinganimationgroupjob.cpp

示例2: animationRemoved

void QSequentialAnimationGroupJob::animationRemoved(QAbstractAnimationJob *anim, QAbstractAnimationJob *prev, QAbstractAnimationJob *next)
{
    QAnimationGroupJob::animationRemoved(anim, prev, next);

    Q_ASSERT(m_currentAnimation); // currentAnimation should always be set

    bool removingCurrent = anim == m_currentAnimation;
    if (removingCurrent) {
        if (next)
            setCurrentAnimation(next); //let's try to take the next one
        else if (prev)
            setCurrentAnimation(prev);
        else// case all animations were removed
            setCurrentAnimation(0);
    }

    // duration of the previous animations up to the current animation
    m_currentTime = 0;
    for (QAbstractAnimationJob *job = firstChild(); job; job = job->nextSibling()) {
        if (job == m_currentAnimation)
            break;
        m_currentTime += animationActualTotalDuration(job);

    }

    if (!removingCurrent) {
        //the current animation is not the one being removed
        //so we add its current time to the current time of this group
        m_currentTime += m_currentAnimation->currentTime();
    }

    //let's also update the total current time
    m_totalCurrentTime = m_currentTime + m_loopCount * duration();
}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:34,代码来源:qsequentialanimationgroupjob.cpp

示例3: updateDirection

void QContinuingAnimationGroupJob::updateDirection(QAbstractAnimationJob::Direction direction)
{
    if (!isStopped()) {
        for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
            animation->setDirection(direction);
        }
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:8,代码来源:qcontinuinganimationgroupjob.cpp

示例4: resetUncontrolledAnimationsFinishTime

void QAnimationGroupJob::resetUncontrolledAnimationsFinishTime()
{
    for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
        if (animation->duration() == -1 || animation->loopCount() < 0) {
            resetUncontrolledAnimationFinishTime(animation);
        }
    }
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:8,代码来源:qanimationgroupjob.cpp

示例5: updateCurrentTime

void QContinuingAnimationGroupJob::updateCurrentTime(int /*currentTime*/)
{
    Q_ASSERT(firstChild());

    for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
        if (animation->state() == state()) {
            RETURN_IF_DELETED(animation->setCurrentTime(m_currentTime));
        }
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:10,代码来源:qcontinuinganimationgroupjob.cpp

示例6: qquick_syncback_helper

static void qquick_syncback_helper(QAbstractAnimationJob *job)
{
    if (job->isRenderThreadJob()) {
        QQuickAnimatorJob *a = static_cast<QQuickAnimatorJob *>(job);
        // Sync back only those jobs that actually have been running
        if (a->controller() && a->hasBeenRunning())
            a->writeBack();
    } else if (job->isGroup()) {
        QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);
        for (QAbstractAnimationJob *a = g->firstChild(); a; a = a->nextSibling())
            qquick_syncback_helper(a);
    }
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:13,代码来源:qquickanimatorjob.cpp

示例7: clear

void QAnimationGroupJob::clear()
{
    QAbstractAnimationJob *child = firstChild();
    QAbstractAnimationJob *nextSibling = 0;
    while (child != 0) {
         child->m_group = 0;
         nextSibling = child->nextSibling();
         delete child;
         child = nextSibling;
    }
    m_firstChild = 0;
    m_lastChild = 0;
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:13,代码来源:qanimationgroupjob.cpp

示例8: duration

int QSequentialAnimationGroupJob::duration() const
{
    int ret = 0;

    for (QAbstractAnimationJob *anim = firstChild(); anim; anim = anim->nextSibling()) {
        const int currentDuration = anim->totalDuration();
        if (currentDuration == -1)
            return -1; // Undetermined length

        ret += currentDuration;
    }

    return ret;
}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:14,代码来源:qsequentialanimationgroupjob.cpp

示例9: uncontrolledAnimationFinished

void QContinuingAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimationJob *animation)
{
    Q_ASSERT(animation && (animation->duration() == -1));
    int uncontrolledRunningCount = 0;

    for (QAbstractAnimationJob *child = firstChild(); child; child = child->nextSibling()) {
        if (child == animation)
            setUncontrolledAnimationFinishTime(animation, animation->currentTime());
        else if (uncontrolledAnimationFinishTime(child) == -1)
            ++uncontrolledRunningCount;
    }

    if (uncontrolledRunningCount > 0)
        return;

    setUncontrolledAnimationFinishTime(this, currentTime());
    stop();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:18,代码来源:qcontinuinganimationgroupjob.cpp

示例10: uncontrolledAnimationFinished

void QSequentialAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimationJob *animation)
{
    Q_UNUSED(animation);
    Q_ASSERT(animation == m_currentAnimation);

    setUncontrolledAnimationFinishTime(m_currentAnimation, m_currentAnimation->currentTime());

    int totalTime = currentTime();
    if (m_direction == Forward) {
        // set the current animation to be the next one
        if (m_currentAnimation->nextSibling())
            setCurrentAnimation(m_currentAnimation->nextSibling());

        for (QAbstractAnimationJob *a = animation->nextSibling(); a; a = a->nextSibling()) {
            int dur = a->duration();
            if (dur == -1) {
                totalTime = -1;
                break;
            } else {
                totalTime += dur;
            }
        }

    } else {
        // set the current animation to be the previous one
        if (m_currentAnimation->previousSibling())
            setCurrentAnimation(m_currentAnimation->previousSibling());

        for (QAbstractAnimationJob *a = animation->previousSibling(); a; a = a->previousSibling()) {
            int dur = a->duration();
            if (dur == -1) {
                totalTime = -1;
                break;
            } else {
                totalTime += dur;
            }
        }
    }
    if (totalTime >= 0)
        setUncontrolledAnimationFinishTime(this, totalTime);
    if (atEnd())
        stop();
}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:43,代码来源:qsequentialanimationgroupjob.cpp

示例11: advanceForwards

void QSequentialAnimationGroupJob::advanceForwards(const AnimationIndex &newAnimationIndex)
{
    if (m_previousLoop < m_currentLoop) {
        // we need to fast forward to the end
        for (QAbstractAnimationJob *anim = m_currentAnimation; anim; anim = anim->nextSibling()) {
            setCurrentAnimation(anim, true);
            RETURN_IF_DELETED(anim->setCurrentTime(animationActualTotalDuration(anim)));
        }
        // this will make sure the current animation is reset to the beginning
        if (firstChild() && !firstChild()->nextSibling())   //count == 1
            // we need to force activation because setCurrentAnimation will have no effect
            activateCurrentAnimation();
        else
            setCurrentAnimation(firstChild(), true);
    }

    // and now we need to fast forward from the current position to
    for (QAbstractAnimationJob *anim = m_currentAnimation; anim && anim != newAnimationIndex.animation; anim = anim->nextSibling()) {     //### WRONG,
        setCurrentAnimation(anim, true);
        RETURN_IF_DELETED(anim->setCurrentTime(animationActualTotalDuration(anim)));
    }
    // setting the new current animation will happen later
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:23,代码来源:qsequentialanimationgroupjob.cpp

示例12: indexForCurrentTime

QSequentialAnimationGroupJob::AnimationIndex QSequentialAnimationGroupJob::indexForCurrentTime() const
{
    Q_ASSERT(firstChild());

    AnimationIndex ret;
    QAbstractAnimationJob *anim = 0;
    int duration = 0;

    for (anim = firstChild(); anim; anim = anim->nextSibling()) {
        duration = animationActualTotalDuration(anim);

        // 'animation' is the current animation if one of these reasons is true:
        // 1. it's duration is undefined
        // 2. it ends after msecs
        // 3. it is the last animation (this can happen in case there is at least 1 uncontrolled animation)
        // 4. it ends exactly in msecs and the direction is backwards
        if (duration == -1 || m_currentTime < (ret.timeOffset + duration)
            || (m_currentTime == (ret.timeOffset + duration) && m_direction == QAbstractAnimationJob::Backward)) {
            ret.animation = anim;
            return ret;
        }

        if (anim == m_currentAnimation) {
            ret.afterCurrent = true;
        }

        // 'animation' has a non-null defined duration and is not the one at time 'msecs'.
        ret.timeOffset += duration;
    }

    // this can only happen when one of those conditions is true:
    // 1. the duration of the group is undefined and we passed its actual duration
    // 2. there are only 0-duration animations in the group
    ret.timeOffset -= duration;
    ret.animation = lastChild();
    return ret;
}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:37,代码来源:qsequentialanimationgroupjob.cpp

示例13: topLevelAnimationLoopChanged

void QAnimationGroupJob::topLevelAnimationLoopChanged()
{
    for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
        animation->topLevelAnimationLoopChanged();
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:5,代码来源:qanimationgroupjob.cpp


注:本文中的QAbstractAnimationJob::nextSibling方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。