From 415c9576cee45938a83c045a32a1ba6a22e89caf Mon Sep 17 00:00:00 2001 From: laserpants Date: Tue, 21 Jun 2016 15:12:52 +0300 Subject: [PATCH] make sure all animations have a parent --- components/scrollwidget.cpp | 3 +-- components/scrollwidget_internal.cpp | 2 +- components/scrollwidget_internal.h | 2 +- components/scrollwidget_p.h | 12 ++++++------ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/components/scrollwidget.cpp b/components/scrollwidget.cpp index d6e2349..b42f8ae 100644 --- a/components/scrollwidget.cpp +++ b/components/scrollwidget.cpp @@ -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(); diff --git a/components/scrollwidget_internal.cpp b/components/scrollwidget_internal.cpp index 8d5fcdd..922dabb 100644 --- a/components/scrollwidget_internal.cpp +++ b/components/scrollwidget_internal.cpp @@ -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); diff --git a/components/scrollwidget_internal.h b/components/scrollwidget_internal.h index af878d6..f1cdd76 100644 --- a/components/scrollwidget_internal.h +++ b/components/scrollwidget_internal.h @@ -23,7 +23,7 @@ private: Q_DISABLE_COPY(ScrollBarStateMachine) ScrollBar *const scrollBar; - qreal _opacity; + qreal _opacity; }; #endif // SCROLLBAR_INTERNAL_H diff --git a/components/scrollwidget_p.h b/components/scrollwidget_p.h index 1ade357..2471338 100644 --- a/components/scrollwidget_p.h +++ b/components/scrollwidget_p.h @@ -18,12 +18,12 @@ public: void init(); - ScrollBar *const q_ptr; - ScrollBarStateMachine *machine; - QColor backgroundColor; - QColor sliderColor; - bool hideOnMouseOut; - bool useThemeColors; + ScrollBar *const q_ptr; + ScrollBarStateMachine *const machine; + QColor backgroundColor; + QColor sliderColor; + bool hideOnMouseOut; + bool useThemeColors; }; #endif // SCROLLWIDGET_P_H