Bug 29859
Summary: | [Qt] Emiting a signal for each page being printed | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tor Arne Vestbø <vestbo> |
Component: | Printing | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Enhancement | CC: | hausmann |
Priority: | P2 | Keywords: | Qt |
Version: | 528+ (Nightly build) | ||
Hardware: | Other | ||
OS: | OS X 10.5 |
Tor Arne Vestbø
This bug report originated from issue QTBUG-3568
http://bugreports.qt.nokia.com/browse/QTBUG-3568
--- Description ---
It would be nice if QtWebkit would emit a signal of each page being printed. This can be used both for user feedback, and for inserting headers and footers. A good name for this signal should obviously be invented. I have included a patch, that I use currently.
patch:
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index ae71356..574e14d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -955,10 +955,13 @@ void QWebFrame::print(QPrinter *printer) const
return;
}
printContext.spoolPage(ctx, page - 1, pageRect.width());
- if (j < pageCopies - 1)
+ if (j < pageCopies - 1) {
+ emit printingNewPage(printer,fromPage,toPage,page);
printer->newPage();
+ }
}
-
+ emit printingNewPage(printer,fromPage,toPage,page);
+
if (page == toPage)
break;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 18ae697..1d40a29 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -21,6 +21,8 @@
#ifndef QWEBFRAME_H
#define QWEBFRAME_H
+#define WKHTMLTOPDF_QT_WEBFRAME_PATCH
+
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
@@ -191,6 +193,7 @@ Q_SIGNALS:
void iconChanged();
+ void printingNewPage(QPrinter *p, int fromPage, int toPage, int Page) const;
private:
friend class QWebPage;
friend class QWebPagePrivate;
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Simon Hausmann
*** This bug has been marked as a duplicate of bug 26584 ***