RESOLVED INVALID 30357
[Qt] Be able to specify a header and footer when printing from WebKit
https://bugs.webkit.org/show_bug.cgi?id=30357
Summary [Qt] Be able to specify a header and footer when printing from WebKit
qt-info
Reported 2009-10-14 05:47:51 PDT
Be able to specify a header and footer when printing from WebKit, this has been requested from a Qt user. Currently they have to render it separately so that the header and footer can be included afterwards when actually printing it. This was requested against Qt 4.5.3 (not sure if the WebKit version matches up or not).
Attachments
no customizable way (4.62 KB, patch)
2010-12-22 10:50 PST, Diego Gonzalez
no flags
Patch (5.40 KB, patch)
2010-12-30 11:30 PST, Diego Gonzalez
ariya.hidayat: review-
Brent Fulgham
Comment 1 2009-12-18 09:25:35 PST
Doesn't the WebUIDelegate provide the ability to specify the header/footer behavior?
Diego Gonzalez
Comment 2 2010-12-22 10:50:53 PST
Created attachment 77234 [details] no customizable way
Diego Gonzalez
Comment 3 2010-12-30 11:30:51 PST
Ariya Hidayat
Comment 4 2010-12-30 15:40:13 PST
Comment on attachment 77691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=77691&action=review r-, in particular because the merging with 26584 needs to be planned > WebKit/qt/Api/qwebframe.cpp:1431 > +QWebPrinter* QWebFrame::webPrinter() > +{ > + static QWebPrinter* p = 0; > + if (!p) > + p = new QWebPrinter; > + > + return p; > +} This will leak memory. > WebKit/qt/Api/qwebframe.h:131 > +class QWEBKIT_EXPORT QWebPrinter { > +public: > + bool printHeaderAndFooter() const { return hasHeaderAndFooter; } > + void setPrintHeaderAndFooter(bool flag = true) { hasHeaderAndFooter = flag; } > + > + void setHeader(const QString& left, const QString& center, const QString& right); > + void setFooter(const QString& left, const QString& center, const QString& right); > + > +private: > + QWebPrinter() > + : hasHeaderAndFooter(false) > + {} > + > + QString headerLeft; > + QString headerCenter; > + QString headerRight; > + QString footerLeft; > + QString footerCenter; > + QString footerRight; > + > + bool hasHeaderAndFooter; > + > + friend class QWebFrame; > +}; > +#endif This is a whole new set of API. Needs some coordinated discussion. For example, this should be merged to Bug 26584.
Diego Gonzalez
Comment 5 2011-01-03 05:11:44 PST
Sure Ariya, I will take at bug 26584 to discuss this merge :) (In reply to comment #4) > (From update of attachment 77691 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=77691&action=review > > r-, in particular because the merging with 26584 needs to be planned > > > WebKit/qt/Api/qwebframe.cpp:1431 > > +QWebPrinter* QWebFrame::webPrinter() > > +{ > > + static QWebPrinter* p = 0; > > + if (!p) > > + p = new QWebPrinter; > > + > > + return p; > > +} > > This will leak memory. > > > WebKit/qt/Api/qwebframe.h:131 > > +class QWEBKIT_EXPORT QWebPrinter { > > +public: > > + bool printHeaderAndFooter() const { return hasHeaderAndFooter; } > > + void setPrintHeaderAndFooter(bool flag = true) { hasHeaderAndFooter = flag; } > > + > > + void setHeader(const QString& left, const QString& center, const QString& right); > > + void setFooter(const QString& left, const QString& center, const QString& right); > > + > > +private: > > + QWebPrinter() > > + : hasHeaderAndFooter(false) > > + {} > > + > > + QString headerLeft; > > + QString headerCenter; > > + QString headerRight; > > + QString footerLeft; > > + QString footerCenter; > > + QString footerRight; > > + > > + bool hasHeaderAndFooter; > > + > > + friend class QWebFrame; > > +}; > > +#endif > > This is a whole new set of API. Needs some coordinated discussion. > > For example, this should be merged to Bug 26584.
Jocelyn Turcotte
Comment 6 2014-02-03 03:15:52 PST
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary. If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.
Note You need to log in before you can comment on or make changes to this bug.