From 627277453810c68f66ac934326df1bea3eed514d Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sun, 27 Jun 2010 11:40:53 +0200 Subject: add comments --- src/webpage.cpp | 7 ++++--- src/websnap.cpp | 9 +++++++-- src/websnap.h | 14 ++------------ 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index 6b45ad10..9e539f7a 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -46,7 +46,7 @@ #include "networkaccessmanager.h" #include "adblockmanager.h" #include "urlbar.h" -#include "websnap.h" +//#include "websnap.h" #include "sslinfodialog_p.h" @@ -212,7 +212,7 @@ WebPage::WebPage(QWidget *parent) WebPage::~WebPage() { - disconnect(); + disconnect(); } @@ -480,7 +480,8 @@ void WebPage::loadFinished(bool ok) { wallet()->fillFormData(mainFrame()); } -/* + +/* this dead code is for try WebSnap::renderVisiblePagePreview() if (ok) { QPixmap preview = WebSnap::renderVisiblePagePreview(*this); diff --git a/src/websnap.cpp b/src/websnap.cpp index db0c791c..29201215 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -101,8 +101,13 @@ QPixmap WebSnap::renderTabPreview(const QWebPage &page, int w, int h) return pageImage.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); } +/* +// This code is an attempt to render a page currently displayed in a tab without alterate it. +// It currently does not work but can give ideas: +// - activate/disable scrollbars of a webview causes problems => this method try to not do that +// - the viewport and the scroll position must be modified an restored +// - page.setViewportSize(size); does not seem to work when the page is currently displayed in a webview -// This method tries to render a page currently displayed in a tab without alterate it. QPixmap WebSnap::renderVisiblePagePreview(const QWebPage &page, int w, int h) { // save page settings @@ -141,7 +146,7 @@ QPixmap WebSnap::renderVisiblePagePreview(const QWebPage &page, int w, int h) return pageImage; } - +*/ QPixmap WebSnap::renderClosingPagePreview(const QWebPage &page, int w, int h) { diff --git a/src/websnap.h b/src/websnap.h index 41db8c71..3baa01fd 100644 --- a/src/websnap.h +++ b/src/websnap.h @@ -90,20 +90,10 @@ public: */ static QPixmap renderPagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); - /** - * Snaps a pixmap of size w * h from a visible page - * - * @param page the page to snap - * @param w the image width - * @param h the image height - * - * @return the pixmap snapped from the page - */ - static QPixmap renderVisiblePagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); - + // static QPixmap renderVisiblePagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); TODO: try to make this method work => more previews for the urlbar /** - * Snaps a pixmap of size w * h from a visible page + * Snaps a pixmap of size w * h from a page of a tab that is currently closing * * @param page the page to snap * @param w the image width -- cgit v1.2.1