Removed use of a weakPointer for storing the glowAnimation in buttons:
it is unnecessary since the object is never accessed outside of the button class, is a child and the button, and thus destroyed only in the button destructor, by Qt. svn path=/trunk/KDE/kdebase/workspace/; revision=1170321
This commit is contained in:
parent
b8137a7671
commit
1a1d2b964b
2 changed files with 22 additions and 17 deletions
|
@ -65,11 +65,11 @@ namespace Oxygen
|
|||
setToolTip(tip);
|
||||
|
||||
// setup animation
|
||||
glowAnimation().data()->setStartValue( 0 );
|
||||
glowAnimation().data()->setEndValue( 1.0 );
|
||||
glowAnimation().data()->setTargetObject( this );
|
||||
glowAnimation().data()->setPropertyName( "glowIntensity" );
|
||||
glowAnimation().data()->setEasingCurve( QEasingCurve::InOutQuad );
|
||||
glowAnimation()->setStartValue( 0 );
|
||||
glowAnimation()->setEndValue( 1.0 );
|
||||
glowAnimation()->setTargetObject( this );
|
||||
glowAnimation()->setPropertyName( "glowIntensity" );
|
||||
glowAnimation()->setEasingCurve( QEasingCurve::InOutQuad );
|
||||
|
||||
// setup connections
|
||||
reset(0);
|
||||
|
@ -107,7 +107,7 @@ namespace Oxygen
|
|||
|
||||
//___________________________________________________
|
||||
void Button::reset( unsigned long )
|
||||
{ glowAnimation().data()->setDuration( client_.configuration().animationsDuration() ); }
|
||||
{ glowAnimation()->setDuration( client_.configuration().animationsDuration() ); }
|
||||
|
||||
|
||||
//___________________________________________________
|
||||
|
@ -119,8 +119,8 @@ namespace Oxygen
|
|||
if( animateButtonHover() )
|
||||
{
|
||||
|
||||
glowAnimation().data()->setDirection( Animation::Forward );
|
||||
if( !isAnimated() ) glowAnimation().data()->start();
|
||||
glowAnimation()->setDirection( Animation::Forward );
|
||||
if( !isAnimated() ) glowAnimation()->start();
|
||||
|
||||
} else update();
|
||||
|
||||
|
@ -134,8 +134,8 @@ namespace Oxygen
|
|||
|
||||
if( status_ == Oxygen::Hovered && animateButtonHover() )
|
||||
{
|
||||
glowAnimation().data()->setDirection( Animation::Backward );
|
||||
if( !isAnimated() ) glowAnimation().data()->start();
|
||||
glowAnimation()->setDirection( Animation::Backward );
|
||||
if( !isAnimated() ) glowAnimation()->start();
|
||||
}
|
||||
|
||||
status_ = Oxygen::Normal;
|
||||
|
|
|
@ -80,11 +80,6 @@ namespace Oxygen
|
|||
|
||||
//!@name glow animation
|
||||
//@{
|
||||
|
||||
//! return animation object
|
||||
virtual const Animation::Pointer& glowAnimation() const
|
||||
{ return glowAnimation_; }
|
||||
|
||||
void setGlowIntensity( qreal value )
|
||||
{
|
||||
if( glowIntensity_ == value ) return;
|
||||
|
@ -99,6 +94,15 @@ namespace Oxygen
|
|||
|
||||
protected:
|
||||
|
||||
//!@name glow animation
|
||||
//@{
|
||||
|
||||
//! return animation object
|
||||
Animation* glowAnimation() const
|
||||
{ return glowAnimation_; }
|
||||
|
||||
//@}
|
||||
|
||||
//! press event
|
||||
void mousePressEvent(QMouseEvent* );
|
||||
|
||||
|
@ -130,7 +134,7 @@ namespace Oxygen
|
|||
|
||||
//! true if animation is in progress
|
||||
bool isAnimated( void ) const
|
||||
{ return glowAnimation().data()->isRunning(); }
|
||||
{ return glowAnimation()->isRunning(); }
|
||||
|
||||
//! true if button is active
|
||||
bool isActive( void ) const;
|
||||
|
@ -177,7 +181,8 @@ namespace Oxygen
|
|||
bool forceInactive_;
|
||||
|
||||
//! glow animation
|
||||
Animation::Pointer glowAnimation_;
|
||||
//Animation::Pointer glowAnimation_;
|
||||
Animation* glowAnimation_;
|
||||
|
||||
//! glow intensity
|
||||
qreal glowIntensity_;
|
||||
|
|
Loading…
Reference in a new issue