[Webkit-unassigned] [Bug 29859] New: [Qt] Emiting a signal for each page being printed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 29 05:44:15 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29859

           Summary: [Qt] Emiting a signal for each page being printed
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Keywords: Qt
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: vestbo at webkit.org


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;

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list