diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-14 00:16:29 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-14 00:16:29 (GMT) |
commit | 74079574c31b41982357e8f809da4686a5d0fd75 (patch) | |
tree | 586c0ecaffd04b2193616341c604d440a48c36da /tools/qmlviewer | |
parent | 24ce9883da082e0ecc38acca2b420f5f38ff7b4f (diff) | |
download | Qt-74079574c31b41982357e8f809da4686a5d0fd75.zip Qt-74079574c31b41982357e8f809da4686a5d0fd75.tar.gz Qt-74079574c31b41982357e8f809da4686a5d0fd75.tar.bz2 |
Fix viewer snapshot/recording.
Diffstat (limited to 'tools/qmlviewer')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index d489412..548434a 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -292,8 +292,7 @@ void QmlViewer::takeSnapShot() { static int snapshotcount = 1; QString snapFileName = QString(QLatin1String("snapshot%1.png")).arg(snapshotcount); - // ### GV - // canvas->asImage().save(snapFileName); + QPixmap::grabWidget(canvas).save(snapFileName); qDebug() << "Wrote" << snapFileName; ++snapshotcount; } @@ -647,12 +646,10 @@ void QmlViewer::timerEvent(QTimerEvent *event) { if (event->timerId() == recordTimer.timerId()) { if (frame_stream) { - // ### GV - // QImage frame(canvas->asImage()); - // frame_stream->write((char*)frame.bits(),frame.numBytes()); + QImage frame = QPixmap::grabWidget(canvas).toImage(); + frame_stream->write((char*)frame.bits(),frame.numBytes()); } else { - // ### GV - // frames.append(new QImage(canvas->asImage())); + frames.append(new QImage(QPixmap::grabWidget(canvas).toImage())); } if (record_autotime && autoTimer.elapsed() >= record_autotime) setRecording(false); |