Widget::Widget(QWidget *parent): QWidget(parent){ w = this->width(); h = this->height(); canvas = new QImage(w, h, QImage::Format_ARGB32); pixels = (int*)canvas->bits(); connect(&timer, SIGNAL(timeout()), this, SLOT(tic())); time.start(); timer.start(20);}Widget::~Widget(){}void Widget::tic(){ setWindowTitle(QString::number(time.elapsed())); time.start(); update();}void Widget::paintEvent(QPaintEvent *){ QPainter p(this); p.drawImage(0, 0, *canvas);}
QTime time;time.start().....qDebug() << time.elapsed();
C++ (Qt)painter->beginNativePainting // юзаем glDrawPixels из opengl painter->endNativePainting