mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-04 16:12:24 +02:00
* Don't try animating with bogus values.
This commit is contained in:
parent
02d3f7c55f
commit
abf4314eaf
@ -28,6 +28,7 @@
|
||||
#include <QPropertyAnimation>
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
|
||||
StatsGauge::StatsGauge( QWidget* parent )
|
||||
@ -110,8 +111,11 @@ StatsGauge::paintEvent( QPaintEvent* event )
|
||||
void
|
||||
StatsGauge::setValue( int v )
|
||||
{
|
||||
if ( maximum() == 0 )
|
||||
return;
|
||||
|
||||
QPropertyAnimation* a = new QPropertyAnimation( (QProgressBar*)this, "value" );
|
||||
a->setEasingCurve( QEasingCurve( QEasingCurve::InOutQuad ) );
|
||||
a->setEasingCurve( QEasingCurve( QEasingCurve::OutQuad ) );
|
||||
a->setStartValue( value() > 0 ? value() : 1 );
|
||||
a->setEndValue( v );
|
||||
a->setDuration( 2000 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user