Hello,

I have a widget, that makes a screenshot every second and paints it out:
Qt Code:
  1. ZoomWidget::ZoomWidget(QWidget* parent) : QWidget(parent)
  2. {
  3. QTimer *timer = new QTimer(this);
  4. connect(timer, SIGNAL(timeout()), this, SLOT(update()));
  5. timer->start(1000);
  6. }
  7.  
  8. void ZoomWidget::paintEvent(QPaintEvent * /*event*/) {
  9. QPainter painter(this);
  10. painter.drawPixmap(0, 0, QPixmap::grabWindow(QApplication::desktop()->winId()), 0, 0, 100, 100);
  11.  
  12. }
To copy to clipboard, switch view to plain text mode 

it works, but slows down my system quite a lot (every second a small lag)

if i change the interval to 1ms, X has 100% percent processor-load.

how could i speed up this?

(i took a look at kmag - which does basically the same thing in qt3 and is much faster - not really fast either - but still better)

niko