make sure all animations have a parent

This commit is contained in:
laserpants 2016-06-21 13:19:10 +03:00
parent d17eb9b32f
commit 1f557c106b
3 changed files with 9 additions and 9 deletions

View File

@ -19,25 +19,27 @@ CheckBoxPrivate::~CheckBoxPrivate()
void CheckBoxPrivate::init()
{
Q_Q(CheckBox);
QPropertyAnimation *animation;
animation = new QPropertyAnimation(checkedIcon, "iconSize");
animation = new QPropertyAnimation(checkedIcon, "iconSize", q);
animation->setStartValue(0);
animation->setEndValue(24);
animation->setDuration(250);
uncheckedTransition->addAnimation(animation);
animation = new QPropertyAnimation(uncheckedIcon, "color");
animation = new QPropertyAnimation(uncheckedIcon, "color", q);
animation->setDuration(250);
uncheckedTransition->addAnimation(animation);
//
animation = new QPropertyAnimation(uncheckedIcon, "color");
animation = new QPropertyAnimation(uncheckedIcon, "color", q);
animation->setDuration(550);
checkedTransition->addAnimation(animation);
animation = new QPropertyAnimation(checkedIcon, "opacity");
animation = new QPropertyAnimation(checkedIcon, "opacity", q);
animation->setDuration(450);
checkedTransition->addAnimation(animation);

View File

@ -9,7 +9,7 @@
CircularProgressPrivate::CircularProgressPrivate(CircularProgress *q)
: q_ptr(q),
delegate(0),
delegate(new CircularProgressDelegate(q)),
progressType(Material::IndeterminateProgress),
size(64),
penWidth(6.25),
@ -25,8 +25,6 @@ void CircularProgressPrivate::init()
{
Q_Q(CircularProgress);
delegate = new CircularProgressDelegate(q);
QSizePolicy policy(QSizePolicy::MinimumExpanding,
QSizePolicy::MinimumExpanding);
q->setSizePolicy(policy);

View File

@ -18,8 +18,8 @@ public:
void init();
CircularProgress *const q_ptr;
CircularProgressDelegate *delegate;
CircularProgress *const q_ptr;
CircularProgressDelegate *const delegate;
Material::ProgressType progressType;
int size;
qreal penWidth;