Printing a file

David Boddie davidb at mcs.st-and.ac.uk
Tue Feb 28 06:48:41 EST 2006


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




More information about the Python-list mailing list