diff options
Diffstat (limited to 'examples/webkit')
-rw-r--r-- | examples/webkit/framecapture/framecapture.cpp | 5 | ||||
-rw-r--r-- | examples/webkit/framecapture/main.cpp | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/examples/webkit/framecapture/framecapture.cpp b/examples/webkit/framecapture/framecapture.cpp index 2c2e11b..4636b8d 100644 --- a/examples/webkit/framecapture/framecapture.cpp +++ b/examples/webkit/framecapture/framecapture.cpp @@ -59,6 +59,7 @@ void FrameCapture::load(const QUrl &url, const QString &outputFileName) m_page.mainFrame()->load(url); m_page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); m_page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + m_page.setViewportSize(QSize(1024, 768)); } void FrameCapture::printProgress(int percent) @@ -88,8 +89,6 @@ void FrameCapture::saveResult(bool ok) int index = m_fileName.lastIndexOf('.'); fileName = fileName.insert(index, "_frame" + QString::number(++frameCounter)); - frame->setClipRenderToViewport(false); - QImage image(frame->contentsSize(), QImage::Format_ARGB32_Premultiplied); image.fill(Qt::transparent); @@ -112,7 +111,7 @@ void FrameCapture::saveFrame(QWebFrame *frame, QImage image, QString fileName) painter.setRenderHint(QPainter::TextAntialiasing, true); painter.setRenderHint(QPainter::SmoothPixmapTransform, true); - frame->render(&painter); + frame->documentElement().render(&painter); painter.end(); diff --git a/examples/webkit/framecapture/main.cpp b/examples/webkit/framecapture/main.cpp index 050947a..65c0026 100644 --- a/examples/webkit/framecapture/main.cpp +++ b/examples/webkit/framecapture/main.cpp @@ -63,7 +63,7 @@ int main(int argc, char * argv[]) return 0; } - QUrl url = QWebView::guessUrlFromString(QString::fromLatin1(argv[1])); + QUrl url = QUrl::fromUserInput(QString::fromLatin1(argv[1])); QString fileName = QString::fromLatin1(argv[2]); QApplication a(argc, argv); |