Bug 405011

Summary: KHTMLView::print() could not share printer instance
Product: [Frameworks and Libraries] frameworks-khtml Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: Martin Sandsmark <martin.sandsmark>
Status: RESOLVED FIXED    
Severity: major CC: kdelibs-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 5.64.0

Description Ralf Habacker 2019-03-03 01:07:58 UTC
For applications that use other KHTMLView, it is not possible with the current implementation of KHTMLView::print() to support common print settings within an application, since a separate QPainter instance is used internally (see https://api.kde.org/frameworks/khtml/html/khtmlview_8cpp_source.html#l#l03128). 

OBSERVED RESULT
When printing KHTMLView based pages, it is necessary to make necessary adjustments before each printout, which is not user friendly.

EXPECTED RESULT
Print settings should only need to be changed once in an application, even when multiple prints are used.

SOFTWARE/OS VERSIONS
All platforms

ADDITIONAL INFORMATION
KHTMLView::print() would have to be extended to use a predefined QPrinter instance.
Comment 1 Ralf Habacker 2019-10-14 10:48:02 UTC
For a related reqiew request see https://phabricator.kde.org/D19504
Comment 2 Ralf Habacker 2019-10-21 19:10:12 UTC
Git commit 2d8cba0507291991c2421963ff23fbba65604e43 by Ralf Habacker.
Committed on 21/10/2019 at 19:12.
Pushed by habacker into branch 'master'.

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

This is required to share printer settings inside an application.
FIXED-IN:5.64.0
Test Plan: compile on linux
Reviewed By: dfaure
Differential Revision: https://phabricator.kde.org/D19504

M  +7    -1    src/khtmlview.cpp
M  +10   -0    src/khtmlview.h

https://commits.kde.org/khtml/2d8cba0507291991c2421963ff23fbba65604e43