Re: Printing a file



Jeremy Sanders wrote:
Fabian Steiner wrote:

Unfortunately I don't know how to realize this, since also some images
and different boxes should be printed out. As the whole application is
based on QT, QPrinter might be used, but I couldn't find any examples
how to use it.

[...]

It's very easy to do. If you want to handle multiple pages and so on,
there's a bit of work to do to interface to the dialog to get the
user-selected page range, etc.

That's where QPrintDialog comes in:

http://doc.trolltech.com/4.1/qprintdialog.html

It's also secretly available in Qt 3 via the QPrinter.setup() method:

printer = QPrinter()
printer.setup()
# Now, paint onto the printer as usual.

David

.



Relevant Pages

  • Re: Printing a file
    ... David Boddie wrote: ... printer = QPrinter() ... paint onto the printer as usual. ... Jeremy Sanders ...
    (comp.lang.python)
  • Re: Printing a file
    ... and different boxes should be printed out. ... QPrinter is easy to use. ... You just draw to the page the same way as you talk ... # do stuff to draw to painter ...
    (comp.lang.python)