Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
0509383cf2
commit
c593492d16
examples/widgets
src
corelib
animation
qabstractanimation.cppqabstractanimation.hqabstractanimation_p.hqanimationgroup.cppqanimationgroup.hqanimationgroup_p.hqparallelanimationgroup.cppqparallelanimationgroup.hqparallelanimationgroup_p.hqpauseanimation.cppqpauseanimation.hqpropertyanimation.cppqpropertyanimation.hqpropertyanimation_p.hqsequentialanimationgroup.cppqsequentialanimationgroup.hqsequentialanimationgroup_p.hqvariantanimation.cppqvariantanimation.hqvariantanimation_p.h
corelib.prostatemachine
gui
widgets
tests/auto/widgets/itemviews/qtreeview
@ -80,9 +80,6 @@ machine.start();
|
||||
\sa QState, {The Animation Framework}
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
/*!
|
||||
Constructs a new state with the given \a parent state.
|
||||
*/
|
||||
@ -155,5 +152,3 @@ bool QAnimationState::event(QEvent *e)
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
@ -61,9 +61,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QAbstractAnimation;
|
||||
|
||||
class QAnimationState : public QState
|
||||
@ -89,8 +86,6 @@ private:
|
||||
QAbstractAnimation *m_animation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QANIMATIONSTATE_H
|
||||
|
@ -27,4 +27,5 @@ qtHaveModule(gui):qtConfig(opengl): \
|
||||
|
||||
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
|
||||
!qtConfig(draganddrop): SUBDIRS -= draganddrop
|
||||
!qtConfig(animation): SUBDIRS -= animation
|
||||
mac:SUBDIRS += mac
|
||||
|
@ -153,8 +153,6 @@
|
||||
#include <QtCore/qcoreevent.h>
|
||||
#include <QtCore/qpointer.h>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
#define DEFAULT_TIMER_INTERVAL 16
|
||||
#define PAUSE_TIMER_COARSE_THRESHOLD 2000
|
||||
|
||||
@ -1485,5 +1483,3 @@ QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qabstractanimation.cpp"
|
||||
#include "moc_qabstractanimation_p.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include <QtCore/qobject.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QAnimationGroup;
|
||||
class QSequentialAnimationGroup;
|
||||
class QAnimationDriver;
|
||||
@ -169,11 +168,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QABSTRACTANIMATION_H
|
||||
|
@ -58,7 +58,7 @@
|
||||
#include <private/qobject_p.h>
|
||||
#include <qabstractanimation.h>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -296,6 +296,4 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
#endif //QABSTRACTANIMATION_P_H
|
||||
|
@ -86,8 +86,6 @@
|
||||
#include <QtCore/qcoreevent.h>
|
||||
#include "qanimationgroup_p.h"
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -300,5 +298,3 @@ void QAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qanimationgroup.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include <QtCore/qabstractanimation.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QAnimationGroupPrivate;
|
||||
class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation
|
||||
{
|
||||
@ -74,8 +73,6 @@ private:
|
||||
Q_DECLARE_PRIVATE(QAnimationGroup)
|
||||
};
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QANIMATIONGROUP_H
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
#include "private/qabstractanimation_p.h"
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -89,6 +89,4 @@ public:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
#endif //QANIMATIONGROUP_P_H
|
||||
|
@ -72,8 +72,6 @@
|
||||
#include "qparallelanimationgroup_p.h"
|
||||
//#define QANIMATION_DEBUG
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
typedef QList<QAbstractAnimation *>::ConstIterator AnimationListConstIt;
|
||||
@ -339,5 +337,3 @@ bool QParallelAnimationGroup::event(QEvent *event)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qparallelanimationgroup.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include <QtCore/qanimationgroup.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QParallelAnimationGroupPrivate;
|
||||
class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup
|
||||
{
|
||||
@ -72,8 +71,6 @@ private:
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished())
|
||||
};
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QPARALLELANIMATIONGROUP
|
||||
|
@ -55,7 +55,7 @@
|
||||
#include "private/qanimationgroup_p.h"
|
||||
#include <QtCore/qhash.h>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -86,6 +86,4 @@ public:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
#endif //QPARALLELANIMATIONGROUP_P_H
|
||||
|
@ -64,9 +64,6 @@
|
||||
#include "qpauseanimation.h"
|
||||
#include "qabstractanimation_p.h"
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QPauseAnimationPrivate : public QAbstractAnimationPrivate
|
||||
@ -150,5 +147,3 @@ void QPauseAnimation::updateCurrentTime(int)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qpauseanimation.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include <QtCore/qanimationgroup.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QPauseAnimationPrivate;
|
||||
|
||||
class Q_CORE_EXPORT QPauseAnimation : public QAbstractAnimation
|
||||
@ -70,8 +69,6 @@ private:
|
||||
Q_DECLARE_PRIVATE(QPauseAnimation)
|
||||
};
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QPAUSEANIMATION_H
|
||||
|
@ -93,8 +93,6 @@
|
||||
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
void QPropertyAnimationPrivate::updateMetaProperty()
|
||||
@ -315,5 +313,3 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
|
||||
#include "moc_qpropertyanimation.cpp"
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include <QtCore/qvariantanimation.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QPropertyAnimationPrivate;
|
||||
class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
|
||||
{
|
||||
@ -75,8 +74,6 @@ private:
|
||||
Q_DECLARE_PRIVATE(QPropertyAnimation)
|
||||
};
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QPROPERTYANIMATION_H
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
#include "private/qvariantanimation_p.h"
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -83,6 +83,4 @@ public:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
#endif //QPROPERTYANIMATION_P_H
|
||||
|
@ -83,8 +83,6 @@
|
||||
|
||||
#include <QtCore/qdebug.h>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
typedef QList<QAbstractAnimation *>::ConstIterator AnimationListConstIt;
|
||||
@ -582,5 +580,3 @@ void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnim
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qsequentialanimationgroup.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include <QtCore/qanimationgroup.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QPauseAnimation;
|
||||
class QSequentialAnimationGroupPrivate;
|
||||
|
||||
@ -82,8 +81,6 @@ private:
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished())
|
||||
};
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QSEQUENTIALANIMATIONGROUP_H
|
||||
|
@ -54,7 +54,7 @@
|
||||
#include "qsequentialanimationgroup.h"
|
||||
#include "private/qanimationgroup_p.h"
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -107,6 +107,4 @@ public:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
#endif //QSEQUENTIALANIMATIONGROUP_P_H
|
||||
|
@ -46,8 +46,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*!
|
||||
@ -700,5 +698,3 @@ void QVariantAnimation::updateCurrentTime(int)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qvariantanimation.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -46,11 +46,10 @@
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qpair.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
class QVariantAnimationPrivate;
|
||||
class Q_CORE_EXPORT QVariantAnimation : public QAbstractAnimation
|
||||
{
|
||||
@ -116,8 +115,6 @@ void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to,
|
||||
QVariantAnimation::registerInterpolator(reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void(*)()>(func)), qMetaTypeId<T>());
|
||||
}
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QVARIANTANIMATION_H
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -129,6 +129,4 @@ template<typename T > inline QVariant _q_interpolateVariant(const T &from, const
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
||||
#endif //QVARIANTANIMATION_P_H
|
||||
|
@ -31,7 +31,7 @@ ANDROID_PERMISSIONS = \
|
||||
# OpenBSD 6.0 will include environ in libc.
|
||||
freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF =
|
||||
|
||||
include(animation/animation.pri)
|
||||
qtConfig(animation): include(animation/animation.pri)
|
||||
include(global/global.pri)
|
||||
include(thread/thread.pri)
|
||||
include(tools/tools.pri)
|
||||
|
@ -334,7 +334,7 @@ QStateMachine *QAbstractTransition::machine() const
|
||||
return d->machine();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
|
||||
/*!
|
||||
Adds the given \a animation to this transition.
|
||||
|
@ -53,7 +53,7 @@ class QAbstractState;
|
||||
class QState;
|
||||
class QStateMachine;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
class QAbstractAnimation;
|
||||
#endif
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
|
||||
QStateMachine *machine() const;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void addAnimation(QAbstractAnimation *animation);
|
||||
void removeAnimation(QAbstractAnimation *animation);
|
||||
QList<QAbstractAnimation*> animations() const;
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
QVector<QPointer<QAbstractState> > targetStates;
|
||||
QAbstractTransition::TransitionType transitionType;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QList<QAbstractAnimation*> animations;
|
||||
#endif
|
||||
};
|
||||
|
@ -59,7 +59,7 @@
|
||||
#include "qeventtransition_p.h"
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
#include "qpropertyanimation.h"
|
||||
#include "qanimationgroup.h"
|
||||
#include <private/qvariantanimation_p.h>
|
||||
@ -167,7 +167,7 @@ QT_BEGIN_NAMESPACE
|
||||
\sa start(), stop(), started(), stopped(), runningChanged()
|
||||
*/
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
/*!
|
||||
\property QStateMachine::animated
|
||||
|
||||
@ -401,7 +401,7 @@ QStateMachinePrivate::QStateMachinePrivate()
|
||||
error = QStateMachine::NoError;
|
||||
globalRestorePolicy = QState::DontRestoreProperties;
|
||||
signalEventGenerator = 0;
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
animated = true;
|
||||
#endif
|
||||
}
|
||||
@ -700,12 +700,12 @@ void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransit
|
||||
|
||||
executeTransitionContent(event, enabledTransitions);
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QList<QAbstractAnimation *> selectedAnimations = selectAnimations(enabledTransitions);
|
||||
#endif
|
||||
|
||||
enterStates(event, exitedStates, enteredStates, statesForDefaultEntry, assignmentsForEnteredStates
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
, selectedAnimations
|
||||
#endif
|
||||
);
|
||||
@ -827,7 +827,7 @@ void QStateMachinePrivate::exitStates(QEvent *event, const QList<QAbstractState*
|
||||
#endif
|
||||
QAbstractStatePrivate::get(s)->callOnExit(event);
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
terminateActiveAnimations(s, assignmentsForEnteredStates);
|
||||
#else
|
||||
Q_UNUSED(assignmentsForEnteredStates);
|
||||
@ -942,7 +942,7 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState
|
||||
const QList<QAbstractState*> &statesToEnter_sorted,
|
||||
const QSet<QAbstractState*> &statesForDefaultEntry,
|
||||
QHash<QAbstractState*, QVector<QPropertyAssignment> > &propertyAssignmentsForState
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
, const QList<QAbstractAnimation *> &selectedAnimations
|
||||
#endif
|
||||
)
|
||||
@ -958,7 +958,7 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState
|
||||
configuration.insert(s);
|
||||
registerTransitions(s);
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
initializeAnimations(s, selectedAnimations, exitedStates_sorted, propertyAssignmentsForState);
|
||||
#endif
|
||||
|
||||
@ -1002,7 +1002,7 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState
|
||||
{
|
||||
QState *ss = toStandardState(s);
|
||||
if (ss
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
&& !animationsForState.contains(s)
|
||||
#endif
|
||||
)
|
||||
@ -1513,7 +1513,7 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
|
||||
QStateMachinePrivate::InitializeAnimationResult
|
||||
QStateMachinePrivate::initializeAnimation(QAbstractAnimation *abstractAnimation,
|
||||
@ -1710,7 +1710,7 @@ void QStateMachinePrivate::initializeAnimations(QAbstractState *state, const QLi
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
QAbstractTransition *QStateMachinePrivate::createInitialTransition() const
|
||||
{
|
||||
@ -1814,7 +1814,7 @@ void QStateMachinePrivate::_q_start()
|
||||
QHash<RestorableId, QVariant> pendingRestorables;
|
||||
QHash<QAbstractState*, QVector<QPropertyAssignment> > assignmentsForEnteredStates =
|
||||
computePropertyAssignments(enteredStates, pendingRestorables);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QList<QAbstractAnimation*> selectedAnimations = selectAnimations(transitions);
|
||||
#endif
|
||||
// enterStates() will set stopProcessingReason to Finished if a final
|
||||
@ -1822,7 +1822,7 @@ void QStateMachinePrivate::_q_start()
|
||||
stopProcessingReason = EventQueueEmpty;
|
||||
enterStates(&nullEvent, exitedStates, enteredStates, statesForDefaultEntry,
|
||||
assignmentsForEnteredStates
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
, selectedAnimations
|
||||
#endif
|
||||
);
|
||||
@ -2957,7 +2957,7 @@ void QStateMachine::onExit(QEvent *event)
|
||||
QState::onExit(event);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
|
||||
/*!
|
||||
Returns whether animations are enabled for this state machine.
|
||||
@ -3004,7 +3004,7 @@ void QStateMachine::removeDefaultAnimation(QAbstractAnimation *animation)
|
||||
d->defaultAnimations.removeAll(animation);
|
||||
}
|
||||
|
||||
#endif // QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
|
||||
// Begin moc-generated code -- modify carefully (check "HAND EDIT" parts)!
|
||||
|
@ -60,7 +60,7 @@ class Q_CORE_EXPORT QStateMachine : public QState
|
||||
Q_PROPERTY(QString errorString READ errorString)
|
||||
Q_PROPERTY(QState::RestorePolicy globalRestorePolicy READ globalRestorePolicy WRITE setGlobalRestorePolicy)
|
||||
Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated)
|
||||
#endif
|
||||
public:
|
||||
@ -122,14 +122,14 @@ public:
|
||||
|
||||
bool isRunning() const;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
bool isAnimated() const;
|
||||
void setAnimated(bool enabled);
|
||||
|
||||
void addDefaultAnimation(QAbstractAnimation *animation);
|
||||
QList<QAbstractAnimation *> defaultAnimations() const;
|
||||
void removeDefaultAnimation(QAbstractAnimation *animation);
|
||||
#endif // QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
QState::RestorePolicy globalRestorePolicy() const;
|
||||
void setGlobalRestorePolicy(QState::RestorePolicy restorePolicy);
|
||||
@ -175,7 +175,7 @@ private:
|
||||
Q_DECLARE_PRIVATE(QStateMachine)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_start())
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_process())
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_animationFinished())
|
||||
#endif
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_startDelayedEventTimer(int, int))
|
||||
|
@ -297,7 +297,7 @@ public:
|
||||
void initializeAnimations(QAbstractState *state, const QList<QAbstractAnimation*> &selectedAnimations,
|
||||
const QList<QAbstractState *> &exitedStates_sorted,
|
||||
QHash<QAbstractState *, QVector<QPropertyAssignment> > &assignmentsForEnteredStates);
|
||||
#endif // QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
QSignalEventGenerator *signalEventGenerator;
|
||||
|
||||
|
@ -38,8 +38,6 @@
|
||||
****************************************************************************/
|
||||
#include <QtGui/qtguiglobal.h>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
#include <QtCore/qvariantanimation.h>
|
||||
#include <private/qvariantanimation_p.h>
|
||||
#include <QtGui/qcolor.h>
|
||||
@ -90,5 +88,3 @@ static void qUnregisterGuiGetInterpolator()
|
||||
Q_DESTRUCTOR_FUNCTION(qUnregisterGuiGetInterpolator)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -45,7 +45,7 @@ include(painting/painting.pri)
|
||||
include(util/util.pri)
|
||||
include(math3d/math3d.pri)
|
||||
include(opengl/opengl.pri)
|
||||
include(animation/animation.pri)
|
||||
qtConfig(animation): include(animation/animation.pri)
|
||||
include(itemmodels/itemmodels.pri)
|
||||
include(vulkan/vulkan.pri)
|
||||
|
||||
|
@ -204,7 +204,7 @@ QInputDeviceManager *QGuiApplicationPrivate::m_inputDeviceManager = 0;
|
||||
static qreal fontSmoothingGamma = 1.7;
|
||||
|
||||
extern void qRegisterGuiVariant();
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
extern void qRegisterGuiGetInterpolator();
|
||||
#endif
|
||||
|
||||
@ -1517,7 +1517,7 @@ void QGuiApplicationPrivate::init()
|
||||
// trigger registering of QVariant's GUI types
|
||||
qRegisterGuiVariant();
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
// trigger registering of animation interpolators
|
||||
qRegisterGuiGetInterpolator();
|
||||
#endif
|
||||
|
@ -47,7 +47,7 @@
|
||||
},
|
||||
"style-mac": {
|
||||
"label": "macOS",
|
||||
"condition": "config.osx",
|
||||
"condition": "config.osx && features.animation",
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-windows": {
|
||||
@ -56,7 +56,7 @@
|
||||
},
|
||||
"style-windowsvista": {
|
||||
"label": "WindowsVista",
|
||||
"condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
|
||||
"condition": "features.style-windows && features.animation && config.win32 && !config.winrt && tests.uxtheme",
|
||||
"output": [ "privateFeature", "styles" ]
|
||||
},
|
||||
"style-android": {
|
||||
|
@ -103,12 +103,12 @@ void QColumnViewPrivate::initialize()
|
||||
{
|
||||
Q_Q(QColumnView);
|
||||
q->setTextElideMode(Qt::ElideMiddle);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QObject::connect(¤tAnimation, SIGNAL(finished()), q, SLOT(_q_changeCurrentColumn()));
|
||||
currentAnimation.setTargetObject(hbar);
|
||||
currentAnimation.setPropertyName("value");
|
||||
currentAnimation.setEasingCurve(QEasingCurve::InOutQuad);
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
delete itemDelegate;
|
||||
q->setItemDelegate(new QColumnViewDelegate(q));
|
||||
}
|
||||
@ -258,12 +258,12 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint)
|
||||
if (!index.isValid() || d->columns.isEmpty())
|
||||
return;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (d->currentAnimation.state() == QPropertyAnimation::Running)
|
||||
return;
|
||||
|
||||
d->currentAnimation.stop();
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
// Fill up what is needed to get to index
|
||||
d->closeColumns(index, true);
|
||||
@ -326,13 +326,13 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (const int animationDuration = style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, this)) {
|
||||
d->currentAnimation.setDuration(animationDuration);
|
||||
d->currentAnimation.setEndValue(newScrollbarValue);
|
||||
d->currentAnimation.start();
|
||||
} else
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
{
|
||||
horizontalScrollBar()->setValue(newScrollbarValue);
|
||||
}
|
||||
@ -402,10 +402,10 @@ void QColumnView::resizeEvent(QResizeEvent *event)
|
||||
void QColumnViewPrivate::updateScrollbars()
|
||||
{
|
||||
Q_Q(QColumnView);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (currentAnimation.state() == QPropertyAnimation::Running)
|
||||
return;
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
// find the total horizontal length of the laid out columns
|
||||
int horizontalLength = 0;
|
||||
|
@ -57,7 +57,9 @@
|
||||
#include <private/qabstractitemview_p.h>
|
||||
|
||||
#include <QtCore/qabstractitemmodel.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <QtCore/qpropertyanimation.h>
|
||||
#endif
|
||||
#include <QtWidgets/qabstractitemdelegate.h>
|
||||
#include <QtWidgets/qabstractitemview.h>
|
||||
#include <QtWidgets/qitemdelegate.h>
|
||||
@ -169,7 +171,7 @@ public:
|
||||
QVector<int> columnSizes; // used during init and corner moving
|
||||
bool showResizeGrips;
|
||||
int offset;
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QPropertyAnimation currentAnimation;
|
||||
#endif
|
||||
QWidget *previewWidget;
|
||||
|
@ -1334,12 +1334,12 @@ void QTreeView::paintEvent(QPaintEvent *event)
|
||||
Q_D(QTreeView);
|
||||
d->executePostedLayout();
|
||||
QPainter painter(viewport());
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (d->isAnimating()) {
|
||||
drawTree(&painter, event->region() - d->animatedOperation.rect());
|
||||
d->drawAnimatedOperation(&painter);
|
||||
} else
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
{
|
||||
drawTree(&painter, event->region());
|
||||
#if QT_CONFIG(draganddrop)
|
||||
@ -3056,10 +3056,10 @@ void QTreeViewPrivate::initialize()
|
||||
header->setStretchLastSection(true);
|
||||
header->setDefaultAlignment(Qt::AlignLeft|Qt::AlignVCenter);
|
||||
q->setHeader(header);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
animationsEnabled = q->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, q) > 0;
|
||||
QObject::connect(&animatedOperation, SIGNAL(finished()), q, SLOT(_q_endAnimatedOperation()));
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
}
|
||||
|
||||
void QTreeViewPrivate::expand(int item, bool emitSignal)
|
||||
@ -3072,10 +3072,10 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
|
||||
if (index.flags() & Qt::ItemNeverHasChildren)
|
||||
return;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (emitSignal && animationsEnabled)
|
||||
prepareAnimatedOperation(item, QVariantAnimation::Forward);
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
//if already animating, stateBeforeAnimation is set to the correct value
|
||||
if (state != QAbstractItemView::AnimatingState)
|
||||
stateBeforeAnimation = state;
|
||||
@ -3089,10 +3089,10 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
|
||||
model->fetchMore(index);
|
||||
if (emitSignal) {
|
||||
emit q->expanded(index);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (animationsEnabled)
|
||||
beginAnimatedOperation();
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
}
|
||||
}
|
||||
|
||||
@ -3147,10 +3147,10 @@ void QTreeViewPrivate::collapse(int item, bool emitSignal)
|
||||
if (it == expandedIndexes.end() || viewItems.at(item).expanded == false)
|
||||
return; // nothing to do
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (emitSignal && animationsEnabled)
|
||||
prepareAnimatedOperation(item, QVariantAnimation::Backward);
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
//if already animating, stateBeforeAnimation is set to the correct value
|
||||
if (state != QAbstractItemView::AnimatingState)
|
||||
@ -3168,14 +3168,14 @@ void QTreeViewPrivate::collapse(int item, bool emitSignal)
|
||||
|
||||
if (emitSignal) {
|
||||
emit q->collapsed(modelIndex);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (animationsEnabled)
|
||||
beginAnimatedOperation();
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void QTreeViewPrivate::prepareAnimatedOperation(int item, QVariantAnimation::Direction direction)
|
||||
{
|
||||
animatedOperation.item = item;
|
||||
@ -3280,7 +3280,7 @@ void QTreeViewPrivate::_q_endAnimatedOperation()
|
||||
q->updateGeometries();
|
||||
viewport->update();
|
||||
}
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
void QTreeViewPrivate::_q_modelAboutToBeReset()
|
||||
{
|
||||
|
@ -230,9 +230,9 @@ private:
|
||||
|
||||
Q_DECLARE_PRIVATE(QTreeView)
|
||||
Q_DISABLE_COPY(QTreeView)
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_endAnimatedOperation())
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_modelAboutToBeReset())
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_sortIndicatorChanged(int column, Qt::SortOrder order))
|
||||
};
|
||||
|
@ -53,7 +53,9 @@
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "private/qabstractitemview_p.h"
|
||||
#if QT_CONFIG(animation)
|
||||
#include <QtCore/qvariantanimation.h>
|
||||
#endif
|
||||
#include <QtCore/qabstractitemmodel.h>
|
||||
#include <QtCore/qvector.h>
|
||||
|
||||
@ -105,7 +107,7 @@ public:
|
||||
QItemViewPaintPairs draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const override;
|
||||
void adjustViewOptionsForIndex(QStyleOptionViewItem *option, const QModelIndex ¤t) const override;
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
struct AnimatedOperation : public QVariantAnimation
|
||||
{
|
||||
int item;
|
||||
@ -123,7 +125,7 @@ public:
|
||||
void drawAnimatedOperation(QPainter *painter) const;
|
||||
QPixmap renderTreeToPixmapForAnimation(const QRect &rect) const;
|
||||
void _q_endAnimatedOperation();
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
void expand(int item, bool emitSignal);
|
||||
void collapse(int item, bool emitSignal);
|
||||
|
@ -105,7 +105,9 @@
|
||||
#include <qsettings.h>
|
||||
#include <qvariant.h>
|
||||
#include <qpixmapcache.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <private/qstyleanimation_p.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
@ -1195,7 +1197,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w
|
||||
}
|
||||
#endif // QT_CONFIG(tabbar)
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
/*! \internal */
|
||||
QList<const QObject*> QCommonStylePrivate::animationTargets() const
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ protected:
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QCommonStyle)
|
||||
Q_DISABLE_COPY(QCommonStyle)
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation())
|
||||
#endif
|
||||
};
|
||||
|
@ -43,8 +43,9 @@
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "qcommonstyle.h"
|
||||
#include "qstyle_p.h"
|
||||
#if QT_CONFIG(animation)
|
||||
#include "qstyleanimation_p.h"
|
||||
|
||||
#endif
|
||||
#include "qstyleoption.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -76,7 +77,7 @@ public:
|
||||
|
||||
~QCommonStylePrivate()
|
||||
{
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
qDeleteAll(animations);
|
||||
#endif
|
||||
#if QT_CONFIG(itemviews)
|
||||
@ -115,7 +116,7 @@ public:
|
||||
#endif
|
||||
|
||||
int animationFps;
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void _q_removeAnimation();
|
||||
|
||||
QList<const QObject*> animationTargets() const;
|
||||
@ -125,7 +126,7 @@ public:
|
||||
|
||||
private:
|
||||
mutable QHash<const QObject*, QStyleAnimation*> animations;
|
||||
#endif // QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -1429,14 +1429,14 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
||||
painter->drawRoundedRect(progressBar.adjusted(1, 1, -1, -1), 1, 1);
|
||||
|
||||
if (!indeterminate) {
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
(const_cast<QFusionStylePrivate*>(d))->stopAnimation(option->styleObject);
|
||||
#endif
|
||||
} else {
|
||||
highlightedGradientStartColor.setAlpha(120);
|
||||
painter->setPen(QPen(highlightedGradientStartColor, 9.0));
|
||||
painter->setClipRect(progressBar.adjusted(1, 1, -1, -1));
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject)))
|
||||
step = animation->animationStep() % 22;
|
||||
else
|
||||
@ -2463,7 +2463,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
||||
styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(scrollBar->state));
|
||||
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(scrollBar->activeSubControls));
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
// if the scrollbar is transient or its attributes, geometry or
|
||||
// state has changed, the opacity is reset back to 100% opaque
|
||||
opacity = 1.0;
|
||||
@ -2481,10 +2481,10 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
||||
} else if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
|
||||
d->stopAnimation(styleObject);
|
||||
}
|
||||
#endif // !QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
|
||||
if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
|
||||
// once a scrollbar was active (hovered/pressed), it retains
|
||||
@ -2513,7 +2513,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
||||
}
|
||||
}
|
||||
painter->setOpacity(opacity);
|
||||
#endif // !QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
}
|
||||
|
||||
bool transient = proxy()->styleHint(SH_ScrollBar_Transient, option, widget);
|
||||
|
@ -39,8 +39,6 @@
|
||||
|
||||
#include "qstyleanimation_p.h"
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qwidget.h>
|
||||
#include <qevent.h>
|
||||
@ -367,5 +365,3 @@ void QScrollbarStyleAnimation::updateCurrentTime(int time)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qstyleanimation_p.cpp"
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -45,9 +45,9 @@
|
||||
#include "qdatetime.h"
|
||||
#include "qimage.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
QT_REQUIRE_CONFIG(animation);
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
@ -201,8 +201,6 @@ private:
|
||||
bool _active;
|
||||
};
|
||||
|
||||
#endif // QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QSTYLEANIMATION_P_H
|
||||
|
@ -84,7 +84,9 @@
|
||||
#include <qheaderview.h>
|
||||
#endif
|
||||
#include <private/qwindowsstyle_p_p.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <private/qstyleanimation_p.h>
|
||||
#endif
|
||||
#if QT_CONFIG(tabbar)
|
||||
#include <qtabbar.h>
|
||||
#endif
|
||||
|
@ -86,7 +86,9 @@
|
||||
#include <private/qhighdpiscaling_p.h>
|
||||
|
||||
#include <private/qstylehelper_p.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <private/qstyleanimation_p.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
HEADERS += \
|
||||
styles/qdrawutil.h \
|
||||
styles/qstyle.h \
|
||||
styles/qstyleanimation_p.h \
|
||||
styles/qstylefactory.h \
|
||||
styles/qstyleoption.h \
|
||||
styles/qstyleplugin.h \
|
||||
@ -21,7 +20,6 @@ HEADERS += \
|
||||
SOURCES += \
|
||||
styles/qdrawutil.cpp \
|
||||
styles/qstyle.cpp \
|
||||
styles/qstyleanimation.cpp \
|
||||
styles/qstylefactory.cpp \
|
||||
styles/qstyleoption.cpp \
|
||||
styles/qstyleplugin.cpp \
|
||||
@ -37,6 +35,11 @@ RESOURCES += styles/qstyle.qrc
|
||||
|
||||
include($$OUT_PWD/qtwidgets-config.pri)
|
||||
|
||||
qtConfig(animation) {
|
||||
HEADERS += styles/qstyleanimation_p.h
|
||||
SOURCES += styles/qstyleanimation.cpp
|
||||
}
|
||||
|
||||
qtConfig(style-windows) {
|
||||
HEADERS += styles/qwindowsstyle_p.h styles/qwindowsstyle_p_p.h
|
||||
SOURCES += styles/qwindowsstyle.cpp
|
||||
|
@ -191,7 +191,7 @@ static qreal progressForValue(const QEasingCurve &curve, qreal value)
|
||||
}
|
||||
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
class QScrollTimer : public QAbstractAnimation
|
||||
{
|
||||
public:
|
||||
@ -230,7 +230,7 @@ private:
|
||||
bool ignoreUpdate;
|
||||
int skip;
|
||||
};
|
||||
#endif // QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
/*!
|
||||
\class QScroller
|
||||
@ -896,7 +896,7 @@ QScrollerPrivate::QScrollerPrivate(QScroller *q, QObject *_target)
|
||||
, snapIntervalX(0.0)
|
||||
, snapFirstY(-1.0)
|
||||
, snapIntervalY(0.0)
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
, scrollTimer(new QScrollTimer(this))
|
||||
#endif
|
||||
, q_ptr(q)
|
||||
@ -938,7 +938,7 @@ const char *QScrollerPrivate::inputName(QScroller::Input input)
|
||||
|
||||
void QScrollerPrivate::targetDestroyed()
|
||||
{
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
scrollTimer->stop();
|
||||
#endif
|
||||
delete q_ptr;
|
||||
@ -966,7 +966,7 @@ void QScrollerPrivate::timerTick()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
scrollTimer->stop();
|
||||
#endif
|
||||
}
|
||||
@ -1690,7 +1690,7 @@ void QScrollerPrivate::setState(QScroller::State newstate)
|
||||
|
||||
switch (newstate) {
|
||||
case QScroller::Inactive:
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
scrollTimer->stop();
|
||||
#endif
|
||||
|
||||
@ -1702,7 +1702,7 @@ void QScrollerPrivate::setState(QScroller::State newstate)
|
||||
break;
|
||||
|
||||
case QScroller::Pressed:
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
scrollTimer->stop();
|
||||
#endif
|
||||
|
||||
@ -1712,14 +1712,14 @@ void QScrollerPrivate::setState(QScroller::State newstate)
|
||||
|
||||
case QScroller::Dragging:
|
||||
dragDistance = QPointF(0, 0);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
if (state == QScroller::Pressed)
|
||||
scrollTimer->start();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case QScroller::Scrolling:
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
scrollTimer->start();
|
||||
#endif
|
||||
break;
|
||||
|
@ -64,7 +64,9 @@
|
||||
#include <qscroller.h>
|
||||
#include <qscrollerproperties.h>
|
||||
#include <private/qscrollerproperties_p.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <QAbstractAnimation>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -72,7 +74,7 @@ QT_BEGIN_NAMESPACE
|
||||
class QFlickGestureRecognizer;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
class QScrollTimer;
|
||||
#endif
|
||||
class QScrollerPrivate : public QObject
|
||||
@ -196,7 +198,7 @@ public:
|
||||
QElapsedTimer monotonicTimer;
|
||||
|
||||
QPointF releaseVelocity; // the starting velocity of the scrolling state
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
QScrollTimer *scrollTimer;
|
||||
#endif
|
||||
|
||||
|
@ -57,7 +57,9 @@
|
||||
#include "qlist.h"
|
||||
#endif
|
||||
#include <qpainter.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <qpropertyanimation.h>
|
||||
#endif
|
||||
#include <qstylehints.h>
|
||||
#include <qvalidator.h>
|
||||
|
||||
@ -390,7 +392,7 @@ void QLineEditIconButton::setOpacity(qreal value)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void QLineEditIconButton::startOpacityAnimation(qreal endValue)
|
||||
{
|
||||
QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity"));
|
||||
|
@ -89,7 +89,7 @@ public:
|
||||
|
||||
qreal opacity() const { return m_opacity; }
|
||||
void setOpacity(qreal value);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void animateShow(bool visible) { startOpacityAnimation(visible ? 1.0 : 0.0); }
|
||||
#endif
|
||||
|
||||
@ -101,7 +101,7 @@ private slots:
|
||||
void updateCursor();
|
||||
|
||||
private:
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void startOpacityAnimation(qreal endValue);
|
||||
#endif
|
||||
QLineEditPrivate *lineEditPrivate() const;
|
||||
|
@ -2109,13 +2109,13 @@ void QTabBarPrivate::moveTabFinished(int index)
|
||||
Q_Q(QTabBar);
|
||||
bool cleanup = (pressedIndex == index) || (pressedIndex == -1) || !validIndex(index);
|
||||
bool allAnimationsFinished = true;
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
for(int i = 0; allAnimationsFinished && i < tabList.count(); ++i) {
|
||||
const Tab &t = tabList.at(i);
|
||||
if (t.animation && t.animation->state() == QAbstractAnimation::Running)
|
||||
allAnimationsFinished = false;
|
||||
}
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
if (allAnimationsFinished && cleanup) {
|
||||
if(movingTab)
|
||||
movingTab->setVisible(false); // We might not get a mouse release
|
||||
@ -2680,7 +2680,7 @@ void CloseButton::paintEvent(QPaintEvent *)
|
||||
style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &p, this);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void QTabBarPrivate::Tab::TabBarAnimation::updateCurrentValue(const QVariant ¤t)
|
||||
{
|
||||
priv->moveTab(priv->tabList.indexOf(*tab), current.toInt());
|
||||
|
@ -58,7 +58,9 @@
|
||||
#include <qicon.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qdebug.h>
|
||||
#if QT_CONFIG(animation)
|
||||
#include <qvariantanimation.h>
|
||||
#endif
|
||||
|
||||
#define ANIMATION_DURATION 250
|
||||
|
||||
@ -107,9 +109,9 @@ public:
|
||||
inline Tab(const QIcon &ico, const QString &txt)
|
||||
: enabled(true) , shortcutId(0), text(txt), icon(ico),
|
||||
leftWidget(0), rightWidget(0), lastTab(-1), dragOffset(0)
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
, animation(0)
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
{}
|
||||
bool operator==(const Tab &other) const { return &other == this; }
|
||||
bool enabled;
|
||||
@ -136,7 +138,7 @@ public:
|
||||
QString accessibleName;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
~Tab() { delete animation; }
|
||||
struct TabBarAnimation : public QVariantAnimation {
|
||||
TabBarAnimation(Tab *t, QTabBarPrivate *_priv) : tab(t), priv(_priv)
|
||||
@ -166,7 +168,7 @@ public:
|
||||
#else
|
||||
void startAnimation(QTabBarPrivate *priv, int duration)
|
||||
{ Q_UNUSED(duration); priv->moveTabFinished(priv->tabList.indexOf(*this)); }
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
};
|
||||
QList<Tab> tabList;
|
||||
mutable QHash<QString, QSize> textSizes;
|
||||
|
@ -37,15 +37,17 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qwidgetanimator_p.h"
|
||||
|
||||
#if QT_CONFIG(animation)
|
||||
#include <QtCore/qpropertyanimation.h>
|
||||
#endif
|
||||
#include <QtWidgets/qwidget.h>
|
||||
#include <QtWidgets/qstyle.h>
|
||||
#if QT_CONFIG(mainwindow)
|
||||
#include <private/qmainwindowlayout_p.h>
|
||||
#endif
|
||||
|
||||
#include "qwidgetanimator_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QWidgetAnimator::QWidgetAnimator(QMainWindowLayout *layout) : m_mainWindowLayout(layout)
|
||||
@ -54,7 +56,7 @@ QWidgetAnimator::QWidgetAnimator(QMainWindowLayout *layout) : m_mainWindowLayout
|
||||
|
||||
void QWidgetAnimator::abort(QWidget *w)
|
||||
{
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
const auto it = m_animation_map.constFind(w);
|
||||
if (it == m_animation_map.cend())
|
||||
return;
|
||||
@ -68,16 +70,16 @@ void QWidgetAnimator::abort(QWidget *w)
|
||||
#endif
|
||||
#else
|
||||
Q_UNUSED(w); //there is no animation to abort
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void QWidgetAnimator::animationFinished()
|
||||
{
|
||||
QPropertyAnimation *anim = qobject_cast<QPropertyAnimation*>(sender());
|
||||
abort(static_cast<QWidget*>(anim->targetObject()));
|
||||
}
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
|
||||
void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, bool animate)
|
||||
{
|
||||
@ -91,7 +93,7 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo
|
||||
const QRect final_geometry = _final_geometry.isValid() || widget->isWindow() ? _final_geometry :
|
||||
QRect(QPoint(-500 - widget->width(), -500 - widget->height()), widget->size());
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
//If the QStyle has animations, animate
|
||||
if (const int animationDuration = widget->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, widget)) {
|
||||
AnimationMap::const_iterator it = m_animation_map.constFind(widget);
|
||||
@ -106,7 +108,7 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo
|
||||
connect(anim, SIGNAL(finished()), SLOT(animationFinished()));
|
||||
anim->start(QPropertyAnimation::DeleteWhenStopped);
|
||||
} else
|
||||
#endif //QT_NO_ANIMATION
|
||||
#endif // animation
|
||||
{
|
||||
//we do it in one shot
|
||||
widget->setGeometry(final_geometry);
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
|
||||
void abort(QWidget *widget);
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
private Q_SLOTS:
|
||||
void animationFinished();
|
||||
#endif
|
||||
|
@ -112,7 +112,7 @@ private slots:
|
||||
void expandAndCollapse();
|
||||
void expandAndCollapseAll();
|
||||
void expandWithNoChildren();
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void quickExpandCollapse();
|
||||
#endif
|
||||
void keyboardNavigation();
|
||||
@ -4401,7 +4401,7 @@ void tst_QTreeView::testInitialFocus()
|
||||
QCOMPARE(treeWidget.currentIndex().column(), 2);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
#if QT_CONFIG(animation)
|
||||
void tst_QTreeView::quickExpandCollapse()
|
||||
{
|
||||
//this unit tests makes sure the state after the animation is restored correctly
|
||||
@ -4433,7 +4433,7 @@ void tst_QTreeView::quickExpandCollapse()
|
||||
|
||||
QCOMPARE(tree.state(), initialState);
|
||||
}
|
||||
#endif
|
||||
#endif // animation
|
||||
|
||||
void tst_QTreeView::taskQTBUG_37813_crash()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user