diff options
Diffstat (limited to 'src/quick/util/qquickanimator.cpp')
-rw-r--r-- | src/quick/util/qquickanimator.cpp | 75 |
1 files changed, 22 insertions, 53 deletions
diff --git a/src/quick/util/qquickanimator.cpp b/src/quick/util/qquickanimator.cpp index f6cc4f3c54..986f695fef 100644 --- a/src/quick/util/qquickanimator.cpp +++ b/src/quick/util/qquickanimator.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qquickanimator_p_p.h" #include "qquickanimatorjob_p.h" @@ -176,7 +140,7 @@ void QQuickAnimator::setTo(qreal to) Q_D(QQuickAnimator); if (to == d->to) return; - d->isToDefined = true; + d->toIsDefined = true; d->to = to; Q_EMIT toChanged(d->to); } @@ -202,7 +166,7 @@ qreal QQuickAnimator::to() const void QQuickAnimator::setFrom(qreal from) { Q_D(QQuickAnimator); - d->isFromDefined = true; + d->fromIsDefined = true; if (from == d->from) return; d->from = from; @@ -231,14 +195,14 @@ void QQuickAnimatorPrivate::apply(QQuickAnimatorJob *job, job->setTarget(qobject_cast<QQuickItem *>(action.property.object())); - if (isFromDefined) + if (fromIsDefined) job->setFrom(from); else if (action.fromValue.isValid()) job->setFrom(action.fromValue.toReal()); else job->setFrom(action.property.read().toReal()); - if (isToDefined) + if (toIsDefined) job->setTo(to); else if (action.toValue.isValid()) job->setTo(action.toValue.toReal()); @@ -255,7 +219,7 @@ void QQuickAnimatorPrivate::apply(QQuickAnimatorJob *job, if (modified.isEmpty()) { job->setTarget(target); - if (isFromDefined) + if (fromIsDefined) job->setFrom(from); job->setTo(to); } @@ -267,7 +231,7 @@ void QQuickAnimatorPrivate::apply(QQuickAnimatorJob *job, job->setTarget(qobject_cast<QQuickItem *>(defaultTarget)); } - if (modified.isEmpty() && !isFromDefined && job->target()) + if (modified.isEmpty() && !fromIsDefined && job->target()) job->setFrom(job->target()->property(propertyName.toLatin1()).toReal()); job->setDuration(duration); @@ -283,7 +247,8 @@ QAbstractAnimationJob *QQuickAnimator::transition(QQuickStateActions &actions, Q_D(QQuickAnimator); if (d->defaultProperty.isValid() && propertyName() != d->defaultProperty.name()) { - qDebug() << Q_FUNC_INFO << "property name conflict..."; + qmlWarning(this) << "property name conflict: \"" + << propertyName() << "\" != \"" << d->defaultProperty.name() << "\""; return nullptr; } @@ -484,14 +449,16 @@ QQuickAnimatorJob *QQuickRotationAnimator::createJob() const { Possible values are: - \list - \li RotationAnimator.Numerical (default) - Rotate by linearly interpolating between the two numbers. - A rotation from 10 to 350 will rotate 340 degrees clockwise. - \li RotationAnimator.Clockwise - Rotate clockwise between the two values - \li RotationAnimator.Counterclockwise - Rotate counterclockwise between the two values - \li RotationAnimator.Shortest - Rotate in the direction that produces the shortest animation path. - A rotation from 10 to 350 will rotate 20 degrees counterclockwise. - \endlist + \value RotationAnimator.Numerical + (default) Rotate by linearly interpolating between the two numbers. + A rotation from 10 to 350 will rotate 340 degrees clockwise. + \value RotationAnimator.Clockwise + Rotate clockwise between the two values + \value RotationAnimator.Counterclockwise + Rotate counterclockwise between the two values + \value RotationAnimator.Shortest + Rotate in the direction that produces the shortest animation path. + A rotation from 10 to 350 will rotate 20 degrees counterclockwise. */ void QQuickRotationAnimator::setDirection(RotationDirection dir) { @@ -508,6 +475,7 @@ QQuickRotationAnimator::RotationDirection QQuickRotationAnimator::direction() co return d->direction; } +#if QT_CONFIG(quick_shadereffect) /*! \qmltype UniformAnimator \instantiates QQuickUniformAnimator @@ -585,6 +553,7 @@ QQuickAnimatorJob *QQuickUniformAnimator::createJob() const job->setUniform(u.toLatin1()); return job; } +#endif QT_END_NAMESPACE |