Classes - Annotated - Tree - Functions - Home - Structure

QPrintDialog Class Reference

The QPrintDialog class provides a dialog for specifying print-out details. More...

#include <qprintdialog.h>

Inherits QDialog.

List of all member functions.

Public Members

Static Public Members


Detailed Description

The QPrintDialog class provides a dialog for specifying print-out details.

Warning: This class is not present on all platforms; use QPrinter::setup() instead for portability.


Member Function Documentation

QPrintDialog::QPrintDialog ( QPrinter * prn, QWidget * parent = 0, const char * name = 0 )

Constructs a new modal printer dialog that configures prn and is a child of parent named name.

QPrintDialog::~QPrintDialog ()

Destroys the object and frees any allocated resources. Does not delete the associated QPrinter object.

void QPrintDialog::addButton ( QPushButton * but )

Adds the button but to the layout of the print dialog. The added buttons are arranged from the left to the right below the last groupbox of the printdialog.

bool QPrintDialog::getPrinterSetup ( QPrinter * p ) [static]

Display a dialog and allow the user to configure the QPrinter p. Returns TRUE if the user clicks OK or presses Enter, FALSE if the user clicks Cancel or presses Escape.

getPrinterSetup() remembers the settings and provides the same settings the next time the dialog is shown.

QPrinter * QPrintDialog::printer () const

Returns a pointer to the printer this dialog configures, or 0 if this dialog does not operate on any printer.

void QPrintDialog::setGlobalPrintDialog ( QPrintDialog * pd ) [static]

This method allows you to specify a global printdialog, given in pd, that will be used instead of the default one provided by Qt.

This is useful, as there are many different printing systems on Unix, and we can not possibly support all of them. Calling this method before using a printer for the first time allows you to set up your own printdialog to use.

See also setupPrinters().

void QPrintDialog::setPrinter ( QPrinter * p, bool pickUpSettings = FALSE )

Sets this dialog to configure printer p, or no printer if p is null. If pickUpSettings is TRUE, the dialog reads most of its settings from p. If pickUpSettings is FALSE (the default) the dialog keeps its old settings.

bool QPrintDialog::setupPrinters ( QListView * printers ) [virtual]

This function is used to specify custom printers in the print dialog. On Unix many different printing systems exist, and we cannot support all of them. If you have a custom printing system that Qt does not support (i.e. the autodetection of available printers fails), you can use this method to specify your own printers.

This virtual method should return FALSE if you couldn't set up the printers in the printers list. In this case Qt will try its own mechanisms to scan for printers. Returning TRUE means you have set up the list of printers correctly and Qt does not need to scan for additional printers in the system.

Warning: this function will change or disappear completely in the final release of Qt 3.0.

See also setGlobalPrintDialog.


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.


Copyright © 2001 TrolltechTrademarks
Qt version 3.0.0-beta2