Image 01
profile-image

oseias

Oseias Santos , Portugal
QProgressIndicator

Qt Widgets by mojo2000 10 comments

Hi,

I'm currently using this tool and I added a grayscale (I called it a grayscale but it's in fact an alphascale). That scale will make the animation all in same colour when it's not running.

to do that I just added these two methos to the cpp file:

bool QProgressIndicator::isGrayscale () const
{
return m_grayscale;
}
void QProgressIndicator::setGrayscale( bool isGrayscale )
{
m_grayscale = isGrayscale;
}

and changed this line at the paint event:

from: color.setAlphaF(1.0f - (i/12.0f));

to: color.setAlphaF( ( isAnimated() || !m_grayscale ? ( 1.0f - ( i/12.0f ) ) : 0.2f ) );

hope this helps :) - Apr 19 2010