From 427dd30f03082bc8e11b3f0caed3dfa6dd23e03b Mon Sep 17 00:00:00 2001 From: laserpants Date: Tue, 21 Jun 2016 15:17:52 +0300 Subject: [PATCH] make sure all animations have a parent --- components/slider_internal.cpp | 44 +++++++++++++++++----------------- components/slider_internal.h | 22 ++++++++--------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/components/slider_internal.cpp b/components/slider_internal.cpp index ec31dd4..37dfad8 100644 --- a/components/slider_internal.cpp +++ b/components/slider_internal.cpp @@ -52,10 +52,10 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(this, SIGNAL(noFocusMouseEnter())); transition->setTargetState(_focusState); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); transition->addAnimation(animation); - transition->addAnimation(new QPropertyAnimation(track, "fillColor")); + transition->addAnimation(new QPropertyAnimation(track, "fillColor", this)); _inactiveState->addTransition(transition); // Show halo on focus in @@ -63,10 +63,10 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QEventTransition(parent, QEvent::FocusIn); transition->setTargetState(_focusState); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); transition->addAnimation(animation); - transition->addAnimation(new QPropertyAnimation(track, "fillColor")); + transition->addAnimation(new QPropertyAnimation(track, "fillColor", this)); _inactiveState->addTransition(transition); // Hide halo on focus out @@ -74,10 +74,10 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QEventTransition(parent, QEvent::FocusOut); transition->setTargetState(_inactiveState); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); transition->addAnimation(animation); - transition->addAnimation(new QPropertyAnimation(track, "fillColor")); + transition->addAnimation(new QPropertyAnimation(track, "fillColor", this)); _focusState->addTransition(transition); // Hide halo on mouse leave, except if widget has focus @@ -85,10 +85,10 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(this, SIGNAL(noFocusMouseLeave())); transition->setTargetState(_inactiveState); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); transition->addAnimation(animation); - transition->addAnimation(new QPropertyAnimation(track, "fillColor")); + transition->addAnimation(new QPropertyAnimation(track, "fillColor", this)); _focusState->addTransition(transition); // Pulse in @@ -96,7 +96,7 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(_pulseOutState, SIGNAL(propertiesAssigned())); transition->setTargetState(_pulseInState); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); animation->setDuration(1000); transition->addAnimation(animation); @@ -107,7 +107,7 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(_pulseInState, SIGNAL(propertiesAssigned())); transition->setTargetState(_pulseOutState); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); animation->setDuration(1000); transition->addAnimation(animation); @@ -117,11 +117,11 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(parent, SIGNAL(sliderPressed())); transition->setTargetState(_slidingState); - animation = new QPropertyAnimation(thumb, "diameter"); + animation = new QPropertyAnimation(thumb, "diameter", this); animation->setDuration(70); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); transition->addAnimation(animation); _focusState->addTransition(transition); @@ -130,11 +130,11 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(parent, SIGNAL(sliderReleased())); transition->setTargetState(_focusState); - animation = new QPropertyAnimation(thumb, "diameter"); + animation = new QPropertyAnimation(thumb, "diameter", this); animation->setDuration(70); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "haloSize"); + animation = new QPropertyAnimation(thumb, "haloSize", this); animation->setEasingCurve(QEasingCurve::InOutSine); transition->addAnimation(animation); _slidingState->addTransition(transition); @@ -149,19 +149,19 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(this, SIGNAL(changedFromMinimum())); transition->setTargetState(_normalState); - animation = new QPropertyAnimation(thumb, "fillColor"); + animation = new QPropertyAnimation(thumb, "fillColor", this); animation->setDuration(200); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "haloColor"); + animation = new QPropertyAnimation(thumb, "haloColor", this); animation->setDuration(300); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "borderColor"); + animation = new QPropertyAnimation(thumb, "borderColor", this); animation->setDuration(200); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "borderWidth"); + animation = new QPropertyAnimation(thumb, "borderWidth", this); animation->setDuration(200); transition->addAnimation(animation); @@ -170,19 +170,19 @@ SliderStateMachine::SliderStateMachine(Slider *parent, transition = new QSignalTransition(this, SIGNAL(changedToMinimum())); transition->setTargetState(_minState); - animation = new QPropertyAnimation(thumb, "fillColor"); + animation = new QPropertyAnimation(thumb, "fillColor", this); animation->setDuration(200); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "haloColor"); + animation = new QPropertyAnimation(thumb, "haloColor", this); animation->setDuration(300); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "borderColor"); + animation = new QPropertyAnimation(thumb, "borderColor", this); animation->setDuration(200); transition->addAnimation(animation); - animation = new QPropertyAnimation(thumb, "borderWidth"); + animation = new QPropertyAnimation(thumb, "borderWidth", this); animation->setDuration(200); transition->addAnimation(animation); diff --git a/components/slider_internal.h b/components/slider_internal.h index 636abac..3c52c30 100644 --- a/components/slider_internal.h +++ b/components/slider_internal.h @@ -27,19 +27,19 @@ signals: private: Q_DISABLE_COPY(SliderStateMachine) - Slider *const slider; + Slider *const slider; SliderTrack *const _track; SliderThumb *const _thumb; - QState *const _topState; - QState *const _fstState; - QState *const _inactiveState; - QState *const _focusState; - QState *const _slidingState; - QState *const _pulseOutState; - QState *const _pulseInState; - QState *const _sndState; - QState *const _minState; - QState *const _normalState; + QState *const _topState; + QState *const _fstState; + QState *const _inactiveState; + QState *const _focusState; + QState *const _slidingState; + QState *const _pulseOutState; + QState *const _pulseInState; + QState *const _sndState; + QState *const _minState; + QState *const _normalState; };