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() void CheckBoxPrivate::init()
{ {
Q_Q(CheckBox);
QPropertyAnimation *animation; QPropertyAnimation *animation;
animation = new QPropertyAnimation(checkedIcon, "iconSize"); animation = new QPropertyAnimation(checkedIcon, "iconSize", q);
animation->setStartValue(0); animation->setStartValue(0);
animation->setEndValue(24); animation->setEndValue(24);
animation->setDuration(250); animation->setDuration(250);
uncheckedTransition->addAnimation(animation); uncheckedTransition->addAnimation(animation);
animation = new QPropertyAnimation(uncheckedIcon, "color"); animation = new QPropertyAnimation(uncheckedIcon, "color", q);
animation->setDuration(250); animation->setDuration(250);
uncheckedTransition->addAnimation(animation); uncheckedTransition->addAnimation(animation);
// //
animation = new QPropertyAnimation(uncheckedIcon, "color"); animation = new QPropertyAnimation(uncheckedIcon, "color", q);
animation->setDuration(550); animation->setDuration(550);
checkedTransition->addAnimation(animation); checkedTransition->addAnimation(animation);
animation = new QPropertyAnimation(checkedIcon, "opacity"); animation = new QPropertyAnimation(checkedIcon, "opacity", q);
animation->setDuration(450); animation->setDuration(450);
checkedTransition->addAnimation(animation); checkedTransition->addAnimation(animation);

View File

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

View File

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