diff --git a/components/checkbox.cpp b/components/checkbox.cpp index d68c93d..32978e7 100644 --- a/components/checkbox.cpp +++ b/components/checkbox.cpp @@ -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); diff --git a/components/circularprogress.cpp b/components/circularprogress.cpp index db51387..29ea6ac 100644 --- a/components/circularprogress.cpp +++ b/components/circularprogress.cpp @@ -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); diff --git a/components/circularprogress_p.h b/components/circularprogress_p.h index 30d2714..9ecf714 100644 --- a/components/circularprogress_p.h +++ b/components/circularprogress_p.h @@ -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;