Fix QT_NO_ANIMATION build
Change-Id: Ia589e703206d6ca675a392e634e2a445dcf4cca3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
f2c7ea7178
commit
bf9a4ef8b4
@ -175,7 +175,9 @@ bool QGuiApplicationPrivate::noGrab = false;
|
||||
static qreal fontSmoothingGamma = 1.7;
|
||||
|
||||
extern void qRegisterGuiVariant();
|
||||
#ifndef QT_NO_ANIMATION
|
||||
extern void qRegisterGuiGetInterpolator();
|
||||
#endif
|
||||
extern void qInitDrawhelperAsm();
|
||||
extern void qInitImageConversions();
|
||||
|
||||
@ -1288,8 +1290,10 @@ void QGuiApplicationPrivate::init()
|
||||
// trigger registering of QVariant's GUI types
|
||||
qRegisterGuiVariant();
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
// trigger registering of animation interpolators
|
||||
qRegisterGuiGetInterpolator();
|
||||
#endif
|
||||
|
||||
QWindowSystemInterfacePrivate::eventTime.start();
|
||||
|
||||
|
@ -1136,6 +1136,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget
|
||||
}
|
||||
#endif //QT_NO_TABBAR
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
/*! \internal */
|
||||
QList<const QObject*> QCommonStylePrivate::animationTargets() const
|
||||
{
|
||||
@ -1176,6 +1177,7 @@ void QCommonStylePrivate::_q_removeAnimation()
|
||||
if (animation)
|
||||
animations.remove(animation->parent());
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
|
@ -98,7 +98,9 @@ protected:
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QCommonStyle)
|
||||
Q_DISABLE_COPY(QCommonStyle)
|
||||
#ifndef QT_NO_ANIMATION
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation())
|
||||
#endif
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -77,7 +77,9 @@ public:
|
||||
|
||||
~QCommonStylePrivate()
|
||||
{
|
||||
#ifndef QT_NO_ANIMATION
|
||||
qDeleteAll(animations);
|
||||
#endif
|
||||
#ifndef QT_NO_ITEMVIEWS
|
||||
delete cachedOption;
|
||||
#endif
|
||||
@ -114,6 +116,7 @@ public:
|
||||
#endif
|
||||
|
||||
int animationFps;
|
||||
#ifndef QT_NO_ANIMATION
|
||||
void _q_removeAnimation();
|
||||
|
||||
QList<const QObject*> animationTargets() const;
|
||||
@ -123,6 +126,7 @@ public:
|
||||
|
||||
private:
|
||||
mutable QHash<const QObject*, QStyleAnimation*> animations;
|
||||
#endif // QT_NO_ANIMATION
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -40,6 +40,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qstyleanimation_p.h"
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qwidget.h>
|
||||
#include <qevent.h>
|
||||
@ -344,3 +347,5 @@ void QScrollbarStyleAnimation::updateCurrentTime(int time)
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_ANIMATION
|
||||
|
@ -48,6 +48,8 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
@ -184,6 +186,8 @@ private:
|
||||
bool _active;
|
||||
};
|
||||
|
||||
#endif // QT_NO_ANIMATION
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QSTYLEANIMATION_P_H
|
||||
|
@ -337,6 +337,7 @@ void QLineEditIconButton::setOpacity(qreal value)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
void QLineEditIconButton::startOpacityAnimation(qreal endValue)
|
||||
{
|
||||
QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity"));
|
||||
@ -344,6 +345,7 @@ void QLineEditIconButton::startOpacityAnimation(qreal endValue)
|
||||
animation->setEndValue(endValue);
|
||||
animation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
}
|
||||
#endif
|
||||
|
||||
void QLineEditIconButton::updateCursor()
|
||||
{
|
||||
@ -358,6 +360,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
|
||||
const int newTextSize = text.size();
|
||||
if (!newTextSize || !lastTextSize) {
|
||||
lastTextSize = newTextSize;
|
||||
#ifndef QT_NO_ANIMATION
|
||||
const bool fadeIn = newTextSize > 0;
|
||||
foreach (const SideWidgetEntry &e, leadingSideWidgets) {
|
||||
if (e.flags & SideWidgetFadeInWithText)
|
||||
@ -367,6 +370,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
|
||||
if (e.flags & SideWidgetFadeInWithText)
|
||||
static_cast<QLineEditIconButton *>(e.widget)->animateShow(fadeIn);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,9 @@ public:
|
||||
|
||||
qreal opacity() const { return m_opacity; }
|
||||
void setOpacity(qreal value);
|
||||
#ifndef QT_NO_ANIMATION
|
||||
void animateShow(bool visible) { startOpacityAnimation(visible ? 1.0 : 0.0); }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
@ -93,7 +95,9 @@ private slots:
|
||||
void updateCursor();
|
||||
|
||||
private:
|
||||
#ifndef QT_NO_ANIMATION
|
||||
void startOpacityAnimation(qreal endValue);
|
||||
#endif
|
||||
|
||||
qreal m_opacity;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user