make sure all animations have a parent
This commit is contained in:
parent
0e61481422
commit
415c9576ce
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
ScrollBarPrivate::ScrollBarPrivate(ScrollBar *q)
|
ScrollBarPrivate::ScrollBarPrivate(ScrollBar *q)
|
||||||
: q_ptr(q),
|
: q_ptr(q),
|
||||||
machine(0),
|
machine(new ScrollBarStateMachine(q)),
|
||||||
hideOnMouseOut(true),
|
hideOnMouseOut(true),
|
||||||
useThemeColors(true)
|
useThemeColors(true)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,6 @@ void ScrollBarPrivate::init()
|
||||||
|
|
||||||
q->setMouseTracking(true);
|
q->setMouseTracking(true);
|
||||||
|
|
||||||
machine = new ScrollBarStateMachine(q);
|
|
||||||
machine->start();
|
machine->start();
|
||||||
|
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
|
|
|
@ -40,7 +40,7 @@ ScrollBarStateMachine::ScrollBarStateMachine(ScrollBar *parent)
|
||||||
|
|
||||||
QPropertyAnimation *animation;
|
QPropertyAnimation *animation;
|
||||||
|
|
||||||
animation = new QPropertyAnimation(this, "opacity");
|
animation = new QPropertyAnimation(this, "opacity", this);
|
||||||
animation->setDuration(340);
|
animation->setDuration(340);
|
||||||
|
|
||||||
addDefaultAnimation(animation);
|
addDefaultAnimation(animation);
|
||||||
|
|
|
@ -23,7 +23,7 @@ private:
|
||||||
Q_DISABLE_COPY(ScrollBarStateMachine)
|
Q_DISABLE_COPY(ScrollBarStateMachine)
|
||||||
|
|
||||||
ScrollBar *const scrollBar;
|
ScrollBar *const scrollBar;
|
||||||
qreal _opacity;
|
qreal _opacity;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SCROLLBAR_INTERNAL_H
|
#endif // SCROLLBAR_INTERNAL_H
|
||||||
|
|
|
@ -18,12 +18,12 @@ public:
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
ScrollBar *const q_ptr;
|
ScrollBar *const q_ptr;
|
||||||
ScrollBarStateMachine *machine;
|
ScrollBarStateMachine *const machine;
|
||||||
QColor backgroundColor;
|
QColor backgroundColor;
|
||||||
QColor sliderColor;
|
QColor sliderColor;
|
||||||
bool hideOnMouseOut;
|
bool hideOnMouseOut;
|
||||||
bool useThemeColors;
|
bool useThemeColors;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SCROLLWIDGET_P_H
|
#endif // SCROLLWIDGET_P_H
|
||||||
|
|
Loading…
Reference in New Issue