Commit a863be59 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: SeekSlider: SeekStyle: fix memleak

parent 934eee8c
...@@ -62,6 +62,7 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static ) ...@@ -62,6 +62,7 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
chapters = NULL; chapters = NULL;
mHandleLength = -1; mHandleLength = -1;
b_seekable = true; b_seekable = true;
alternativeStyle = NULL;
// prepare some static colors // prepare some static colors
QPalette p = palette(); QPalette p = palette();
...@@ -111,7 +112,10 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static ) ...@@ -111,7 +112,10 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
/* Use the new/classic style */ /* Use the new/classic style */
if( !b_classic ) if( !b_classic )
setStyle( new SeekStyle ); {
alternativeStyle = new SeekStyle;
setStyle( alternativeStyle );
}
/* Init to 0 */ /* Init to 0 */
setPosition( -1.0, 0, 0 ); setPosition( -1.0, 0, 0 );
...@@ -135,6 +139,8 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static ) ...@@ -135,6 +139,8 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
SeekSlider::~SeekSlider() SeekSlider::~SeekSlider()
{ {
delete chapters; delete chapters;
if ( alternativeStyle )
delete alternativeStyle;
} }
/*** /***
......
...@@ -46,6 +46,7 @@ class QTimer; ...@@ -46,6 +46,7 @@ class QTimer;
class SeekPoints; class SeekPoints;
class QPropertyAnimation; class QPropertyAnimation;
class QStyleOption; class QStyleOption;
class QCommonStyle;
/* Input Slider derived from QSlider */ /* Input Slider derived from QSlider */
class SeekSlider : public QSlider class SeekSlider : public QSlider
...@@ -96,6 +97,8 @@ private: ...@@ -96,6 +97,8 @@ private:
QColor tickpointForeground; QColor tickpointForeground;
QColor shadowDark; QColor shadowDark;
QColor shadowLight; QColor shadowLight;
QCommonStyle *alternativeStyle;
/* Handle's animation */ /* Handle's animation */
qreal mHandleOpacity; qreal mHandleOpacity;
QPropertyAnimation *animHandle; QPropertyAnimation *animHandle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment