WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 26584
29859
[Qt] Emiting a signal for each page being printed
https://bugs.webkit.org/show_bug.cgi?id=29859
Summary
[Qt] Emiting a signal for each page being printed
Tor Arne Vestbø
Reported
2009-09-29 05:44:15 PDT
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
Comment 1
2009-11-24 07:53:17 PST
*** This bug has been marked as a duplicate of
bug 26584
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug