summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAndre Pedralho <andre.pedralho@openbossa.org>2009-11-19 16:15:38 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-19 16:15:38 (GMT)
commit34dbd7b720875e4e266beee66f6f41e624ea5aad (patch)
tree1e04e224d4a30080425038f05eabfc1a7c256171 /examples
parentb752acf1805eebd64e7e833862690e9ebdb714e3 (diff)
downloadQt-34dbd7b720875e4e266beee66f6f41e624ea5aad.zip
Qt-34dbd7b720875e4e266beee66f6f41e624ea5aad.tar.gz
Qt-34dbd7b720875e4e266beee66f6f41e624ea5aad.tar.bz2
Updated the 'framecapture' WebKit example according to WebKit API changes.
Merge-request: 2142 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/webkit/framecapture/framecapture.cpp5
-rw-r--r--examples/webkit/framecapture/main.cpp2
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);