Extend KHtmlView::print() to use a predefined QPrinter instance
ClosedPublic

Authored by habacker on Mar 4 2019, 8:41 AM.

Details

Summary

This is required to share printer settings inside an application.

BUG:405011

Test Plan

compile on linux

Diff Detail

Repository
R313 KHtml
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
habacker created this revision.Mar 4 2019, 8:41 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 4 2019, 8:41 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
habacker requested review of this revision.Mar 4 2019, 8:41 AM
tbaumgart added inline comments.
src/khtmlview.cpp
3140

Why don't you pass a reference to the QPrinter object here?

habacker marked an inline comment as done.Mar 6 2019, 4:54 PM
habacker added inline comments.
src/khtmlview.cpp
3140

Because api dealing with QPrinter always use a pointer.

void QWebView::print(QPrinter *)
void QPrintPreviewDialog::paintRequested(QPrinter *printer)
QPrintPreviewDialog(QPrinter *printer, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()
QPrintDialog(QPrinter * printer, QWidget * parent = 0)
QPageSetupDialog(QPrinter *printer, QWidget *parent)
QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt::WindowFlags flags)

aacid added a subscriber: aacid.Mar 6 2019, 6:31 PM

The code is fine, the bigger question here is if we want new features in khtml that is part of the "portingAids" part of frameworks.

src/khtmlview.h
216

Needs a @since marker.

habacker updated this revision to Diff 53327.Mar 7 2019, 12:37 AM
habacker marked an inline comment as done.
  • added @since tag

The patch was added to build the stable version of KMyMoney
for Windows to fix an issue not been able to have common
printer settings. Since KHTML is the successor of kdelilbs,
it has been ported to KF5.

habacker marked 2 inline comments as done.Mar 7 2019, 12:39 AM
habacker updated this revision to Diff 67894.Oct 14 2019, 11:30 AM
  • Another attempt after 9 minor releases have elapsed.
dfaure accepted this revision.Oct 15 2019, 6:41 AM
This revision is now accepted and ready to land.Oct 15 2019, 6:41 AM
This revision was automatically updated to reflect the committed changes.