Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
windows:mingw:win32
mingw32-kdelibs4
0001-Make-KHtmlView-print-be-able-to-use-a-pred...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Make-KHtmlView-print-be-able-to-use-a-predefined-QPr.patch of Package mingw32-kdelibs4
From 33419207e1f99e326ce87323e2d2f9d6473d288a Mon Sep 17 00:00:00 2001 From: Ralf Habacker <ralf.habacker@freenet.de> Date: Tue, 5 Mar 2019 21:15:41 +0100 Subject: [PATCH] Make KHtmlView::print() be able to use a predefined QPrinter instance This is required to share printer setting inside an application. --- CMakeLists.txt | 2 +- khtml/khtmlview.cpp | 8 +++++++- khtml/khtmlview.h | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50225a5..38dae86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ include(CPack) set (KDE_VERSION_MAJOR 4) set (KDE_VERSION_MINOR 14) -set (KDE_VERSION_RELEASE 60) +set (KDE_VERSION_RELEASE 65) set (KDE_VERSION "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" ) set (KDE_VERSION_STRING "${KDE_VERSION}") diff --git a/khtml/khtmlview.cpp b/khtml/khtmlview.cpp index 1ac2339..f341fa8 100644 --- a/khtml/khtmlview.cpp +++ b/khtml/khtmlview.cpp @@ -3026,13 +3026,19 @@ namespace { void KHTMLView::print(bool quick) { + QPrinter printer; + print(&printer, quick); +} + +void KHTMLView::print(QPrinter *_printer, bool quick) +{ if(!m_part->xmlDocImpl()) return; khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer()); if(!root) return; QPointer<KHTMLPrintSettings> printSettings(new KHTMLPrintSettings); //XXX: doesn't save settings between prints like this const QPointerDeleter settingsDeleter(printSettings); //the printdialog takes ownership of the settings widget, thus this workaround to avoid double deletion - QPrinter printer; + QPrinter &printer = *_printer; QPointer<QPrintDialog> dialog = KdePrint::createPrintDialog(&printer, KdePrint::SystemSelectsPages, QList<QWidget*>() << printSettings.data(), this); const QPointerDeleter dialogDeleter(dialog); diff --git a/khtml/khtmlview.h b/khtml/khtmlview.h index 801f9a2..923be6b 100644 --- a/khtml/khtmlview.h +++ b/khtml/khtmlview.h @@ -32,6 +32,7 @@ #include <QtGui/QScrollArea> class QPainter; +class QPrinter; class QRect; template< typename T > class QVector; template <class T> class QStack; @@ -183,6 +184,7 @@ public: * @param quick if true, fully automated printing, without print dialog */ void print( bool quick = false ); + void print(QPrinter *printer, bool quick = false); /** * Display all accesskeys in small tooltips -- 1.8.4.5
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor