Question

I was just wondering if it is possible to use my existing MFC created DC to associate with a QPrinter so that it directly uses the existing DC rather creates its own with QPrintDialog?

Does QPrinter make use of Qt's backingstore as QWidget does, i.e., does it create an off-screen image before printing?

No correct solution

OTHER TIPS

First thing: QPrintDialog has nothing to do with your question. You can set-up a QPrinter without using QPrintDialog.

Anyway: You paint into a QPainter where QPrinter is "only" the printing device. Printing only starts when you end the QPainter. So there is a backing store when using QPrinter.

You can't convert a DC to a QPainter so QPrinter can't do anything with a DC. The closest thing would be to get a Bitmap from the DC and print it to a fresh QPainter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top