G'day All,
I have a potentially long running (10-20 seconds) print job that I'm providing a QProgressDialog for. I'd like to be able to cancel the job cleanly.
My paintRequested() routine first paginates then renders the pages. During pagination I detect a cancellation request and exit the pagination with a boolean flag, which causes the actual rendering to be skipped. A similar check in the rendering routine aborts the rendering.
I appreciate that what has already gone to the printer cannot be recalled. It would be nice though to have the QPrintPreviewDialog not open if the process was cancelled.
I was going to emit a custom signal from paintRequested() connected to a slot in the object that owns the preview dialog; it would destroy the QPrintPreviewDialog object. This seems rather draconian. Is there a more elegant way to do this?
Cheers,
Chris W
Bookmarks