void PixmapAnimator::updateCurrentTime( int msecs ) { int i = msecs / interval; if ( i >= pixmaps.count() ) i = pixmaps.count() - 1; /* roundings */ if ( i != current_frame ) { current_frame = i; currentPixmap = pixmaps.at( current_frame ); emit pixmapReady( *currentPixmap ); } }
void Screenshoter::shootArea() { if(!grabAreaWidget_) { return; } QPixmap pix; const QRect rect = grabAreaWidget_->getRect(); delete grabAreaWidget_; grabAreaWidget_ = 0; if(rect.isValid()) { qApp->desktop()->repaint(); qApp->beep(); pix = QPixmap::grabWindow(QApplication::desktop()->winId(), rect.x(), rect.y(), rect.width(), rect.height()); } if(!pix.isNull()) emit pixmapReady(pix); else emit refreshWindow(); }
void Screenshoter::shoot(WId id) { qApp->beep(); emit pixmapReady(QPixmap::grabWindow(id)); }