PDA

View Full Version : QWebView printing finished signal



criskross
12th March 2014, 13:02
Hi,

is there any signal that is emitted when QWebView has finished printing to a Printer? I am using it to print into a pdf and after that i would like to use this pdf but it does not exist when trying to access it right after using QWebView.print(...)

Does someone has an idea how to fix this problem?

Thx,
Christian

anda_skoa
12th March 2014, 16:49
Have you tried after the QPrinter object that you pass to print() has been destroyed?

Cheers,
_

criskross
12th March 2014, 17:05
What do u mean with that? I am using python....

anda_skoa
12th March 2014, 19:46
Well, I was thinking: QWebView' print() is a method that gets called with a QPrinter instance.
Its documentation suggest that the webview is done printing when the method returns.

This is emphasised by the C++ signature taking the QPrinter as a pointer and the documentation not indicating a transfer of ownership, meaning WebView can't safely access the printer anymore after it returned from the method call.

Since you say that right after that you do not have the result yet, it might be that QPrinter does not immediately write to the backend, for whatever reason.
But it has to be finished when it is destroyed.

I don't know about the Python bindings, but maybe they have a way to explicitly destroy the wrapped C++ instance behind the python proxy object?

Cheers,
_