30 #include <QStyleOption>
57 const int a = qRound(alpha * 256);
58 const int ia = 256 -
a;
67 for (
int sy = 0; sy < sh; sy++) {
68 quint32 *mixed =
reinterpret_cast<quint32 *
>(mixed_data);
69 const quint32 *back =
reinterpret_cast<const quint32 *
>(back_data);
70 const quint32 *front =
reinterpret_cast<const quint32 *
>(front_data);
71 for (
int sx = 0; sx < sw; sx++) {
72 quint32 bp = back[sx];
73 quint32 fp = front[sx];
75 (qRed(bp) * ia + qRed(fp) * a) >> 8, (qGreen(bp) * ia + qGreen(fp) * a) >> 8,
76 (qBlue(bp) * ia + qBlue(fp) * a) >> 8, (qAlpha(bp) * ia + qAlpha(fp) * a) >> 8);
93 QTime current = QTime::currentTime();
112 for (
int i = animations.size() - 1;
i >= 0; --
i) {
113 if (animations[
i]->widget())
114 animations[
i]->widget()->update();
116 if (!animations[
i]->widget() || !animations[
i]->widget()->isEnabled()
117 || !animations[
i]->widget()->isVisible()
118 || animations[
i]->widget()->window()->isMinimized() || !animations[
i]->running()) {
123 if (animations.size() == 0 && animationTimer.isActive()) {
124 animationTimer.stop();
130 for (
int i = animations.size() - 1;
i >= 0; --
i) {
131 if (animations[
i]->widget() == w) {
142 animations.append(t);
143 if (animations.size() > 0 && !animationTimer.isActive()) {
144 animationTimer.start(35,
this);
void drawBlendedImage(QPainter *painter, QRect rect, float value)
virtual void paint(QPainter *painter, const QStyleOption *option)
Animation * widgetAnimation(const QWidget *) const
virtual void paint(QPainter *painter, const QStyleOption *option)
void timerEvent(QTimerEvent *)
void stopAnimation(const QWidget *)
void startAnimation(Animation *)