1QPrinter(3qt)                                                    QPrinter(3qt)
2
3
4

NAME

6       QPrinter - Paint device that paints on a printer
7

SYNOPSIS

9       #include <qprinter.h>
10
11       Inherits QPaintDevice.
12
13   Public Members
14       enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution,
15           Compatible }
16       QPrinter ( PrinterMode m = ScreenResolution )
17       ~QPrinter ()
18       enum Orientation { Portrait, Landscape }
19       enum PageSize { A4, B5, Letter, Legal, Executive, A0, A1, A2, A3, A5,
20           A6, A7, A8, A9, B0, B1, B10, B2, B3, B4, B6, B7, B8, B9, C5E,
21           Comm10E, DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom }
22       enum PageOrder { FirstPageFirst, LastPageFirst }
23       enum ColorMode { GrayScale, Color }
24       enum PaperSource { OnlyOne, Lower, Middle, Manual, Envelope,
25           EnvelopeManual, Auto, Tractor, SmallFormat, LargeFormat,
26           LargeCapacity, Cassette, FormSource }
27       enum PrintRange { AllPages, Selection, PageRange }
28       enum PrinterOption { PrintToFile, PrintSelection, PrintPageRange }
29       QString printerName () const
30       virtual void setPrinterName ( const QString & name )
31       bool outputToFile () const
32       virtual void setOutputToFile ( bool enable )
33       QString outputFileName () const
34       virtual void setOutputFileName ( const QString & fileName )
35       QString printProgram () const
36       virtual void setPrintProgram ( const QString & printProg )
37       QString printerSelectionOption () const
38       virtual void setPrinterSelectionOption ( const QString & option )
39       QString docName () const
40       virtual void setDocName ( const QString & name )
41       QString creator () const
42       virtual void setCreator ( const QString & creator )
43       Orientation orientation () const
44       virtual void setOrientation ( Orientation orientation )
45       PageSize pageSize () const
46       virtual void setPageSize ( PageSize newPageSize )
47       void setWinPageSize ( short winPageSize )
48       short winPageSize () const
49       virtual void setPageOrder ( PageOrder newPageOrder )
50       PageOrder pageOrder () const
51       virtual void setResolution ( int dpi )
52       virtual int resolution () const
53       virtual void setColorMode ( ColorMode newColorMode )
54       ColorMode colorMode () const
55       virtual void setFullPage ( bool fp )
56       bool fullPage () const
57       QSize margins () const
58       void setMargins ( uint top, uint left, uint bottom, uint right )
59       void margins ( uint * top, uint * left, uint * bottom, uint * right )
60           const
61       int fromPage () const
62       int toPage () const
63       virtual void setFromTo ( int fromPage, int toPage )
64       int minPage () const
65       int maxPage () const
66       virtual void setMinMax ( int minPage, int maxPage )
67       int numCopies () const
68       virtual void setNumCopies ( int numCopies )
69       PrintRange printRange () const
70       void setPrintRange ( PrintRange range )
71       bool newPage ()
72       bool abort ()
73       bool aborted () const
74       bool setup ( QWidget * parent = 0 )
75       PaperSource paperSource () const
76       virtual void setPaperSource ( PaperSource source )
77       void setOptionEnabled ( PrinterOption option, bool enable )
78       bool isOptionEnabled ( PrinterOption option )
79

DESCRIPTION

81       The QPrinter class is a paint device that paints on a printer.
82
83       On Windows it uses the built-in printer drivers. On X11 it generates
84       postscript and sends that to lpr, lp, or another print command.
85
86       QPrinter is used in much the same way as QWidget and QPixmap are used.
87       The big difference is that you must keep track of the pages.
88
89       QPrinter supports a number of settable parameters, most of which can be
90       changed by the end user when the application calls QPrinter::setup().
91
92       The most important parameters are:
93
94       setOrientation() tells QPrinter which page orientation to use
95       (virtual).
96
97       setPageSize() tells QPrinter what page size to expect from the printer.
98
99       setResolution() tells QPrinter what resolution you wish the printer to
100       provide (in dpi).
101
102       setFullPage() tells QPrinter whether you want to deal with the full
103       page or just with the part the printer can draw on. The default is
104       FALSE, so that by default you should be able to paint on (0,0). If TRUE
105       the origin of the coordinate system will be in the top left corner of
106       the paper and most probably the printer will not be able to paint
107       something there due to it's physical margins.
108
109       setNumCopies() tells QPrinter how many copies of the document it should
110       print.
111
112       setMinMax() tells QPrinter and QPrintDialog what the allowed range for
113       fromPage() and toPage() are.
114
115       Except where noted, you can only call the set functions before setup(),
116       or between QPainter::end() and setup(). (Some may take effect between
117       setup() and begin(), or between begin() and end(), but that's strictly
118       undocumented and such behaviour may differ depending on platform.)
119
120       There are also some settings that the user sets (through the printer
121       dialog) and that applications are expected to obey:
122
123       pageOrder() tells the application program whether to print first-page-
124       first or last-page-first.
125
126       colorMode() tells the application program whether to print in color or
127       grayscale. (If you print in color and the printer does not support
128       color, Qt will try to approximate. The document may take longer to
129       print, but the quality should not be made visibly poorer.)
130
131       fromPage() and toPage() indicate what pages the application program
132       should print.
133
134       paperSource() tells the application progam which paper source to print
135       from.
136
137       You can of course call these functions to establish defaults before you
138       ask the user through QPrinter::setup().
139
140       Once you start printing, calling newPage() is essential. You will
141       probably also need to look at the QPaintDeviceMetrics for the printer
142       (see the print function in the Application walk-through). In previous
143       versions, paint device metrics were valid only after the QPrinter has
144       been set up, i.e. after setup() has returned successfully. This is no
145       longer the case and paint device metrics can be requested safely before
146       set up.
147
148       If you want to abort the print job, abort() will try its best to stop
149       printing. It may cancel the entire job or just some of it.
150
151       If your current locale converts "," to ".", you will need to set a
152       locale (via the standard C setlocale() function) that doen't do this
153       before using QPrinter. The "C" locale works well for this.
154
155       The TrueType font embedding for Qt's postscript driver uses code by
156       David Chappell of Trinity College Computing Center.
157
158       Copyright 1995, Trinity College Computing Center. Written by David
159       Chappell.
160
161       Permission to use, copy, modify, and distribute this software and its
162       documentation for any purpose and without fee is hereby granted,
163       provided that the above copyright notice appear in all copies and that
164       both that copyright notice and this permission notice appear in
165       supporting documentation. This software is provided "as is" without
166       express or implied warranty.
167
168       TrueType font support. These functions allow PPR to generate PostScript
169       fonts from Microsoft compatible TrueType font files.
170
171       The functions in this file do most of the work to convert a TrueType
172       font to a type 3 PostScript font.
173
174       Most of the material in this file is derived from a program called"
175       ttf2ps" which L. S. Ng posted to the usenet news group"
176       comp.sources.postscript". The author did not provide a copyright notice
177       or indicate any restrictions on use.
178
179       Last revised 11 July 1995.
180
181       See also Graphics Classes and Image Processing Classes.
182
183   Member Type Documentation

QPrinter::ColorMode

185       This enum type is used to indicate whether QPrinter should print in
186       color or not.
187
188       QPrinter::Color - print in color if available, otherwise in grayscale.
189
190       QPrinter::GrayScale - print in grayscale, even on color printers. Might
191       be a little faster than Color. This is the default.
192

QPrinter::Orientation

194       This enum type (not to be confused with Qt::Orientation) is used to
195       specify each page's orientation.
196
197       QPrinter::Portrait - the page's height is greater than its width (the
198       default).
199
200       QPrinter::Landscape - the page's width is greater than its height.
201
202       This type interacts with QPrinter::PageSize and QPrinter::setFullPage()
203       to determine the final size of the page available to the application.
204

QPrinter::PageOrder

206       This enum type is used by QPrinter to tell the application program how
207       to print.
208
209       QPrinter::FirstPageFirst - the lowest-numbered page should be printed
210       first.
211
212       QPrinter::LastPageFirst - the highest-numbered page should be printed
213       first.
214

QPrinter::PageSize

216       This enum type specifies what paper size QPrinter should use. QPrinter
217       does not check that the paper size is available; it just uses this
218       information, together with QPrinter::Orientation and
219       QPrinter::setFullPage(), to determine the printable area (see
220       QPaintDeviceMetrics).
221
222       The defined sizes (with setFullPage(TRUE)) are:
223
224       QPrinter::A0 - 841 x 1189 mm This value is not supported on windows.
225
226       QPrinter::A1 - 594 x 841 mm This value is not supported on windows.
227
228       QPrinter::A2 - 420 x 594 mm
229
230       QPrinter::A3 - 297 x 420 mm
231
232       QPrinter::A4 - 210 x 297 mm, 8.26 x 11.7 inches
233
234       QPrinter::A5 - 148 x 210 mm
235
236       QPrinter::A6 - 105 x 148 mm
237
238       QPrinter::A7 - 74 x 105 mm
239
240       QPrinter::A8 - 52 x 74 mm
241
242       QPrinter::A9 - 37 x 52 mm
243
244       QPrinter::B0 - 1030 x 1456 mm
245
246       QPrinter::B1 - 728 x 1030 mm
247
248       QPrinter::B10 - 32 x 45 mm
249
250       QPrinter::B2 - 515 x 728 mm
251
252       QPrinter::B3 - 364 x 515 mm
253
254       QPrinter::B4 - 257 x 364 mm
255
256       QPrinter::B5 - 182 x 257 mm, 7.17 x 10.13 inches
257
258       QPrinter::B6 - 128 x 182 mm
259
260       QPrinter::B7 - 91 x 128 mm
261
262       QPrinter::B8 - 64 x 91 mm
263
264       QPrinter::B9 - 45 x 64 mm
265
266       QPrinter::C5E - 163 x 229 mm
267
268       QPrinter::Comm10E - 105 x 241 mm, US Common #10 Envelope
269
270       QPrinter::DLE - 110 x 220 mm
271
272       QPrinter::Executive - 7.5 x 10 inches, 191 x 254 mm
273
274       QPrinter::Folio - 210 x 330 mm
275
276       QPrinter::Ledger - 432 x 279 mm
277
278       QPrinter::Legal - 8.5 x 14 inches, 216 x 356 mm
279
280       QPrinter::Letter - 8.5 x 11 inches, 216 x 279 mm
281
282       QPrinter::Tabloid - 279 x 432 mm
283
284       QPrinter::Custom
285
286       QPrinter::NPageSize - (internal)
287
288       With setFullPage(FALSE) (the default), the metrics will be a bit
289       smaller; how much depends on the printer in use.
290

QPrinter::PaperSource

292       This enum type specifies what paper source QPrinter is to use. QPrinter
293       does not check that the paper source is available; it just uses this
294       information to try and set the paper source. Whether it will set the
295       paper source depends on whether the printer has that particular source.
296
297       Note: this is currently only implemented for Windows.
298
299       QPrinter::OnlyOne
300
301       QPrinter::Lower
302
303       QPrinter::Middle
304
305       QPrinter::Manual
306
307       QPrinter::Envelope
308
309       QPrinter::EnvelopeManual
310
311       QPrinter::Auto
312
313       QPrinter::Tractor
314
315       QPrinter::SmallFormat
316
317       QPrinter::LargeFormat
318
319       QPrinter::LargeCapacity
320
321       QPrinter::Cassette
322
323       QPrinter::FormSource
324

QPrinter::PrintRange

326       This enum is used to specify which print range the application should
327       use to print.
328
329       QPrinter::AllPages - All pages should be printed
330
331       QPrinter::Selection - Only the selection should be printed.
332
333       QPrinter::PageRange - From page, to page option.
334
335       See also setPrintRange() and printRange().
336

QPrinter::PrinterMode

338       This enum describes the mode the printer should work in. It basically
339       presets a certain resolution and working mode.
340
341       QPrinter::ScreenResolution - Sets the resolution of the print device to
342       the screen resolution. This has the big advantage that the results
343       obtained when painting on the printer will match more or less exactly
344       the visible output on the screen. It is the easiest to use, as font
345       metrics on the screen and on the printer are the same. This is the
346       default value. ScreenResolution will produce a lower quality output
347       than HighResolution and should only be used for drafts.
348
349       QPrinter::PrinterResolution - Use the physical resolution of the
350       printer on Windows. On Unix, set the postscript resolution to 72 dpi.
351
352       QPrinter::HighResolution - Use printer resolution on windows, set the
353       resolution of the postscript driver to 600dpi.
354
355       QPrinter::Compatible - Almost the same as PrinterResolution, but keeps
356       some peculiarities of the Qt 2.x printer driver. This is useful for
357       applications ported from Qt 2.x to Qt 3.x.
358

QPrinter::PrinterOption

360       This enum describes various printer options that appear in the printer
361       setup dialog. It is used to enable and disable these options in the
362       setup dialog.
363
364       QPrinter::PrintToFile - Describes if print to file should be enabled.
365
366       QPrinter::PrintSelection - Describes if printing selections should be
367       enabled.
368
369       QPrinter::PrintPageRange - Describes if printing page ranges (from, to)
370       should be enabled
371
372       See also setOptionEnabled() and isOptionEnabled().
373

MEMBER FUNCTION DOCUMENTATION

QPrinter::QPrinter ( PrinterMode m = ScreenResolution )

376       Constructs a printer paint device with mode m.
377
378       See also QPrinter::PrinterMode.
379

QPrinter::~QPrinter ()

381       Destroys the printer paint device and cleans up.
382

bool QPrinter::abort ()

384       Aborts the print job. Returns TRUE if successful; otherwise returns
385       FALSE.
386
387       See also aborted().
388

bool QPrinter::aborted () const

390       Returns TRUE if the print job was aborted; otherwise returns FALSE.
391
392       See also abort().
393

ColorMode QPrinter::colorMode () const

395       Returns the current color mode. The default color mode is Color.
396
397       See also setColorMode().
398

QString QPrinter::creator () const

400       Returns the name of the application that created the document.
401
402       See also setCreator().
403

QString QPrinter::docName () const

405       Returns the document name.
406
407       See also setDocName().
408

int QPrinter::fromPage () const

410       Returns the from-page setting. The default value is 0.
411
412       If fromPage() and toPage() both return 0 this signifies 'print the
413       whole document'.
414
415       The programmer is responsible for reading this setting and printing
416       accordingly.
417
418       See also setFromTo() and toPage().
419

bool QPrinter::fullPage () const

421       Returns TRUE if the origin of the printer's coordinate system is at the
422       corner of the sheet and FALSE if it is at the edge of the printable
423       area.
424
425       See setFullPage() for details and caveats.
426
427       See also setFullPage(), PageSize, and QPaintDeviceMetrics.
428

bool QPrinter::isOptionEnabled ( PrinterOption option )

430       Returns TRUE if the printer option with identifier option is enabled;
431       otherwise returns FALSE.
432
433       See also setOptionEnabled().
434

QSize QPrinter::margins () const

436       Returns the width of the left margin and the height of the top margin
437       of the printer. On Unix, this is a best-effort guess, not based on
438       perfect knowledge.
439
440       If you have called setFullPage( TRUE ), margins().width() may be
441       treated as the smallest sane left margin you can use, and
442       margins().height() as the smallest sane top margin you can use.
443
444       If you have called setFullPage( FALSE ) (this is the default),
445       margins() is automatically subtracted from the pageSize() by QPrinter.
446
447       See also setFullPage(), QPaintDeviceMetrics, and PageSize.
448

void QPrinter::margins ( uint * top, uint * left, uint * bottom, uint * right

450       ) const
451       This is an overloaded member function, provided for convenience. It
452       behaves essentially like the above function.
453
454       Sets top, left, bottom and right to the margins of the printer. On
455       Unix, this is a best-effort guess, not based on perfect knowledge.
456
457       If you have called setFullPage( TRUE ), the four values specify the
458       smallest sane margins you can use.
459
460       If you have called setFullPage( FALSE ) (this is the default), the
461       margins are automatically subtracted from the pageSize() by QPrinter.
462
463       See also setFullPage(), QPaintDeviceMetrics, and PageSize.
464

int QPrinter::maxPage () const

466       Returns the max-page setting. A user can't choose a higher page number
467       than maxPage() when they select a print range. The default value is 0.
468
469       See also minPage(), setMinMax(), and setFromTo().
470

int QPrinter::minPage () const

472       Returns the min-page setting, i.e. the lowest page number a user is
473       allowed to choose. The default value is 0.
474
475       See also maxPage(), setMinMax(), and setFromTo().
476

bool QPrinter::newPage ()

478       Advances to a new page on the printer. Returns TRUE if successful;
479       otherwise returns FALSE.
480
481       Examples:
482

int QPrinter::numCopies () const

484       Returns the number of copies to be printed. The default value is 1.
485
486       This value will return the number of times the application is required
487       to print in order to match the number specified in the printer setup
488       dialog. This has been done since some printer drivers are not capable
489       of buffering up the copies and the application in those cases have to
490       make an explicit call to the print code for each copy.
491
492       See also setNumCopies().
493

Orientation QPrinter::orientation () const

495       Returns the orientation setting. The default value is
496       QPrinter::Portrait.
497
498       See also setOrientation().
499

QString QPrinter::outputFileName () const

501       Returns the name of the output file. There is no default file name.
502
503       See also setOutputFileName() and setOutputToFile().
504

bool QPrinter::outputToFile () const

506       Returns TRUE if the output should be written to a file, or FALSE if the
507       output should be sent directly to the printer. The default setting is
508       FALSE.
509
510       This function is currently only supported under X11 and Mac OS X.
511
512       See also setOutputToFile() and setOutputFileName().
513

PageOrder QPrinter::pageOrder () const

515       Returns the current page order.
516
517       The default page order is FirstPageFirst.
518
519       Bugs and limitations:
520
521       This value is not kept in sync with the Windows or Mac OS X printer
522       dialogs.
523

PageSize QPrinter::pageSize () const

525       Returns the printer page size. The default value is system-dependent.
526
527       See also setPageSize().
528

PaperSource QPrinter::paperSource () const

530       Returns the currently set paper source of the printer.
531
532       See also setPaperSource().
533

QString QPrinter::printProgram () const

535       Returns the name of the program that sends the print output to the
536       printer.
537
538       The default is to return a null string; meaning that QPrinter will try
539       to be smart in a system-dependent way. On X11 only, you can set it to
540       something different to use a specific print program.
541
542       On Windows, this function returns the name of the printer device
543       driver.
544
545       See also setPrintProgram() and setPrinterSelectionOption().
546

PrintRange QPrinter::printRange () const

548       Returns the PageRange of the QPrinter. After the print setup dialog has
549       been opened, this function returns the value selected by the user.
550
551       See also setPrintRange().
552

QString QPrinter::printerName () const

554       Returns the printer name. This value is initially set to the name of
555       the default printer.
556
557       See also setPrinterName().
558

QString QPrinter::printerSelectionOption () const

560       Returns the printer options selection string. This is useful only if
561       the print command has been explicitly set.
562
563       The default value (a null string) implies that the printer should be
564       selected in a system-dependent manner.
565
566       Any other value implies that the given value should be used.
567
568       See also setPrinterSelectionOption().
569

int QPrinter::resolution () const [virtual]

571       Returns the current assumed resolution of the printer, as set by
572       setResolution() or by the printer subsystem.
573
574       See also setResolution().
575

void QPrinter::setColorMode ( ColorMode newColorMode ) [virtual]

577       Sets the printer's color mode to newColorMode, which can be either
578       Color or GrayScale (the default).
579
580       See also colorMode().
581

void QPrinter::setCreator ( const QString & creator ) [virtual]

583       Sets the name of the application that created the document to creator.
584
585       This function is only applicable to the X11 version of Qt. If no
586       creator name is specified, the creator will be set to "Qt" followed by
587       some version number.
588
589       See also creator().
590

void QPrinter::setDocName ( const QString & name ) [virtual]

592       Sets the document name to name.
593

void QPrinter::setFromTo ( int fromPage, int toPage ) [virtual]

595       Sets the from-page and to-page settings to fromPage and toPage
596       respectively.
597
598       The from-page and to-page settings specify what pages to print.
599
600       If fromPage() and toPage() both return 0 this signifies 'print the
601       whole document'.
602
603       This function is useful mostly to set a default value that the user can
604       override in the print dialog when you call setup().
605
606       See also fromPage(), toPage(), setMinMax(), and setup().
607

void QPrinter::setFullPage ( bool fp ) [virtual]

609       Sets QPrinter to have the origin of the coordinate system at the top-
610       left corner of the paper if fp is TRUE, or where it thinks the top-left
611       corner of the printable area is if fp is FALSE.
612
613       The default is FALSE. You can (probably) print on (0,0), and
614       QPaintDeviceMetrics will report something smaller than the size
615       indicated by PageSize. (Note that QPrinter may be wrong on Unix systems
616       - it does not have perfect knowledge of the physical printer.)
617
618       If you set fp to TRUE, QPaintDeviceMetrics will report the exact same
619       size as indicated by PageSize, but you cannot print on all of that -
620       you must take care of the output margins yourself.
621
622       See also PageSize, setPageSize(), QPaintDeviceMetrics, and fullPage().
623
624       Examples:
625

void QPrinter::setMargins ( uint top, uint left, uint bottom, uint right )

627       Sets the printer margins to the sizes specified in top, left, bottom
628       and right.
629
630       This function currently only has an effect on Unix systems.
631
632       See also margins().
633

void QPrinter::setMinMax ( int minPage, int maxPage ) [virtual]

635       Sets the min-page and max-page settings to minPage and maxPage
636       respectively.
637
638       The min-page and max-page restrict the from-page and to-page settings.
639       When the printer setup dialog appears, the user cannot select a from
640       page or a to page that are outside the range specified by min and max
641       pages.
642
643       See also minPage(), maxPage(), setFromTo(), and setup().
644

void QPrinter::setNumCopies ( int numCopies ) [virtual]

646       Sets the number of copies to be printed to numCopies.
647
648       The printer driver reads this setting and prints the specified number
649       of copies.
650
651       See also numCopies() and setup().
652

void QPrinter::setOptionEnabled ( PrinterOption option, bool enable )

654       Enables the printer option with the identifier option if enable is
655       TRUE, and disables option option if enable is FALSE.
656
657       See also isOptionEnabled().
658

void QPrinter::setOrientation ( Orientation orientation ) [virtual]

660       Sets the print orientation to orientation.
661
662       The orientation can be either QPrinter::Portrait or
663       QPrinter::Landscape.
664
665       The printer driver reads this setting and prints using the specified
666       orientation. On Windows this setting won't take effect until the
667       printer dialog is shown (using QPrinter::setup()).
668
669       Windows only! This option can be changed while printing and will take
670       effect from the next call to newPage()
671
672       See also orientation().
673

void QPrinter::setOutputFileName ( const QString & fileName ) [virtual]

675       Sets the name of the output file to fileName.
676
677       Setting a null or empty name (0 or "") disables output to a file, i.e.
678       calls setOutputToFile(FALSE). Setting a non-empty name enables output
679       to a file, i.e. calls setOutputToFile(TRUE).
680
681       This function is currently only supported under X11.
682
683       See also outputFileName() and setOutputToFile().
684

void QPrinter::setOutputToFile ( bool enable ) [virtual]

686       Specifies whether the output should be written to a file or sent
687       directly to the printer.
688
689       Will output to a file if enable is TRUE, or will output directly to the
690       printer if enable is FALSE.
691
692       This function is currently only supported under X11 and Mac OS X.
693
694       See also outputToFile() and setOutputFileName().
695

void QPrinter::setPageOrder ( PageOrder newPageOrder ) [virtual]

697       Sets the page order to newPageOrder.
698
699       The page order can be QPrinter::FirstPageFirst or
700       QPrinter::LastPageFirst. The application programmer is responsible for
701       reading the page order and printing accordingly.
702
703       This function is useful mostly for setting a default value that the
704       user can override in the print dialog when you call setup().
705
706       Bugs and limitations:
707
708       This value is not kept in sync with the Windows or Mac OS X printer
709       dialogs.
710

void QPrinter::setPageSize ( PageSize newPageSize ) [virtual]

712       Sets the printer page size to newPageSize if that size is supported.
713       The result if undefined if newPageSize is not supported.
714
715       The default page size is system-dependent.
716
717       This function is useful mostly for setting a default value that the
718       user can override in the print dialog when you call setup().
719
720       See also pageSize(), PageSize, setFullPage(), and setResolution().
721

void QPrinter::setPaperSource ( PaperSource source ) [virtual]

723       Sets the paper source setting to source.
724
725       Windows only! This option can be changed while printing and will take
726       effect from the next call to newPage()
727
728       See also paperSource().
729

void QPrinter::setPrintProgram ( const QString & printProg ) [virtual]

731       Sets the name of the program that should do the print job to printProg.
732
733       On X11, this function sets the program to call with the PostScript
734       output. On other platforms, it has no effect.
735
736       See also printProgram().
737

void QPrinter::setPrintRange ( PrintRange range )

739       Sets the default selected page range to be used when the print setup
740       dialog is opened to range. If the PageRange specified by range is
741       currently disabled the function does nothing.
742
743       See also printRange().
744

void QPrinter::setPrinterName ( const QString & name ) [virtual]

746       Sets the printer name to name.
747
748       The default printer will be used if no printer name is set.
749
750       Under X11, the PRINTER environment variable defines the default
751       printer. Under any other window system, the window system defines the
752       default printer.
753
754       See also printerName().
755

void QPrinter::setPrinterSelectionOption ( const QString & option ) [virtual]

757       Sets the printer to use option to select the printer. option is null by
758       default (which implies that Qt should be smart enough to guess
759       correctly), but it can be set to other values to use a specific printer
760       selection option.
761
762       If the printer selection option is changed while the printer is active,
763       the current print job may or may not be affected.
764
765       See also printerSelectionOption().
766

void QPrinter::setResolution ( int dpi ) [virtual]

768       Requests that the printer prints at dpi or as near to dpi as possible.
769
770       This setting affects the coordinate system as returned by, for example,
771       QPaintDeviceMetrics and QPainter::viewport().
772
773       The value depends on the PrintingMode used in the QPrinter constructor.
774       By default, the dpi value of the screen is used.
775
776       This function must be called before setup() to have an effect on all
777       platforms.
778
779       See also resolution() and setPageSize().
780

void QPrinter::setWinPageSize ( short winPageSize )

782       Windows only, using this function is not portable! Sets the windows
783       page size value that is used by the DEVMODE struct. The winPageSize
784       value must be one of the DMPAPER_ defines from wingdi.h.
785

bool QPrinter::setup ( QWidget * parent = 0 )

787       Opens a printer setup dialog, with parent parent, and asks the user to
788       specify which printer they wish to use and what settings it should
789       have.
790
791       Returns TRUE if the user pressed "OK" to print, or FALSE if the user
792       canceled the operation.
793
794       Examples:
795

int QPrinter::toPage () const

797       Returns the to-page setting. The default value is 0.
798
799       If fromPage() and toPage() both return 0 this signifies 'print the
800       whole document'.
801
802       The programmer is responsible for reading this setting and printing
803       accordingly.
804
805       See also setFromTo() and fromPage().
806

short QPrinter::winPageSize () const

808       Returns the Windows page size value as used by the DEVMODE struct
809       (Windows only). Using this function is not portable.
810
811       Use pageSize() to get the PageSize, e.g. 'A4', 'Letter', etc.
812
813

SEE ALSO

815       http://doc.trolltech.com/qprinter.html
816       http://www.trolltech.com/faq/tech.html
817
819       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
820       license file included in the distribution for a complete license
821       statement.
822

AUTHOR

824       Generated automatically from the source code.
825

BUGS

827       If you find a bug in Qt, please report it as described in
828       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
829       help you. Thank you.
830
831       The definitive Qt documentation is provided in HTML format; it is
832       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
833       web browser. This man page is provided as a convenience for those users
834       who prefer man pages, although this format is not officially supported
835       by Trolltech.
836
837       If you find errors in this manual page, please report them to qt-
838       bugs@trolltech.com.  Please include the name of the manual page
839       (qprinter.3qt) and the Qt version (3.3.8).
840
841
842
843Trolltech AS                    2 February 2007                  QPrinter(3qt)
Impressum