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