November 2018
Intermediate to advanced
1150 pages
24h 11m
English
Let's apply what we learned about the Qt Animation Framework to our project. Each time the user clicks on a filter thumbnail, we want to poke it. All modifications will be done on the FilterWidget class. Let's start with FilterWidget.h:
#include <QPropertyAnimation>
class FilterWidget : public QWidget
{
Q_OBJECT
public:
explicit FilterWidget(Filter& filter, QWidget *parent = 0);
~FilterWidget();
...
private:
void initAnimations();
void startSelectionAnimation();
private:
...
QPropertyAnimation mSelectionAnimation;
};
The first function, initAnimations(), initializes the animations used by FilterWidget. The second function, startSelectionAnimation(), performs tasks required to start this animation correctly. As ...
Read now
Unlock full access