make sure all animations have a parent

This commit is contained in:
laserpants 2016-06-21 15:12:52 +03:00
parent 0e61481422
commit 415c9576ce
4 changed files with 9 additions and 10 deletions

View File

@ -7,7 +7,7 @@
ScrollBarPrivate::ScrollBarPrivate(ScrollBar *q)
: q_ptr(q),
machine(0),
machine(new ScrollBarStateMachine(q)),
hideOnMouseOut(true),
useThemeColors(true)
{
@ -23,7 +23,6 @@ void ScrollBarPrivate::init()
q->setMouseTracking(true);
machine = new ScrollBarStateMachine(q);
machine->start();
QCoreApplication::processEvents();

View File

@ -40,7 +40,7 @@ ScrollBarStateMachine::ScrollBarStateMachine(ScrollBar *parent)
QPropertyAnimation *animation;
animation = new QPropertyAnimation(this, "opacity");
animation = new QPropertyAnimation(this, "opacity", this);
animation->setDuration(340);
addDefaultAnimation(animation);

View File

@ -19,7 +19,7 @@ public:
void init();
ScrollBar *const q_ptr;
ScrollBarStateMachine *machine;
ScrollBarStateMachine *const machine;
QColor backgroundColor;
QColor sliderColor;
bool hideOnMouseOut;