void SCAnimationDirector::paint(QPainter &painter, const QRectF &paintRect) { if (m_pageEffectRunner) { bool finished = m_pageEffectRunner->isFinished(); if (!m_pageEffectRunner->paint(painter)) { delete m_pageEffectRunner; m_pageEffectRunner = 0; // check if there where a animation to start if (hasAnimation()) { if (finished) { QRect clipRect = m_pageRect.intersected(paintRect.toRect()); painter.setClipRect(clipRect); painter.setRenderHint(QPainter::Antialiasing); paintStep(painter); } else { // start the animations startTimeLine(m_animations.at(m_stepIndex)->totalDuration()); } } } } else { QRect clipRect = m_pageRect.intersected(paintRect.toRect()); painter.setClipRect(clipRect); painter.setRenderHint(QPainter::Antialiasing); paintStep(painter); } // This is needed as otherwise on some ATI graphic cards it leads to // 100% CPU load of the x server and no more key events are received // until the page effect is finished. With it is made sure that key // events still get through so that it is possible to cancel the // events. It looks like this is not a problem with nvidia graphic // cards. KApplication::kApplication()->syncX(); }
// Take one step, indicating whether it was a successful step void ProgressBar::step( bool successful ) { m_progress++; int x = m_progressX; m_progressX = scale (m_progress); if ( !m_error && !successful ) { m_error = true; x = 1; } paintStep( x, m_progressX ); }
// Take one step, indicating whether it was a successful step void ProgressBar::step (bool successful) { _progress++; int x = _progressX; _progressX = scale (_progress); if (!_error && !successful) { _error = true; x = 1; } paintStep (x, _progressX); }