Qt:Документация 4.3.2/qprinter-qt3
Материал из Wiki.crossplatform.ru
![]() | Внимание: Актуальная версия перевода документации находится здесь |
__NOTOC__
Главная · Все классы · Основные классы · Классы по группам · Модули · Функции |
[править] Qt 3 Support Members for QPrinter
Описанные ниже члены класса являются частью слоя поддержки Qt 3. Они введены для поддержки старого кода в Qt 4. Мы советуем не использовать их во вновь создаваемом коде.
[править] Открытые типы
- enum PrinterOption { PrintToFile, PrintSelection, PrintPageRange }
[править] Открытые функции
- bool aborted ()
- bool collateCopiesEnabled () const
- bool isOptionEnabled ( PrinterOption option ) const
- void margins ( uint * top, uint * left, uint * bottom, uint * right ) const
- QSize margins () const
- int maxPage () const
- int minPage () const
- bool outputToFile () const
- bool pageSetup ( QWidget * parent = 0 )
- bool printSetup ( QWidget * parent = 0 )
- void setCollateCopiesEnabled ( bool enable )
- void setMinMax ( int minPage, int maxPage )
- void setOptionEnabled ( PrinterOption option, bool enable )
- void setOutputToFile ( bool enable )
- bool setup ( QWidget * parent = 0 )
- 8 открытых функций, унаследованных от QPaintDevice
[править] Описание типов
[править] enum QPrinter::PrinterOption
Use QAbstractPrintDialog::PrintDialogOption instead.
Константа | Значение |
---|---|
QPrinter::PrintToFile | 0 |
QPrinter::PrintSelection | 1 |
QPrinter::PrintPageRange | 2 |
[править] Описание функций-членов
[править] bool QPrinter::aborted ()
Use printerState() == QPrinter::Aborted instead.
[править] bool QPrinter::collateCopiesEnabled () const
Returns true if the printer is set up to collate copies of printed documents; otherwise returns false.
Use QPrintDialog::isOptionEnabled( QPrintDialog::PrintCollateCopies) instead.
See also setCollateCopiesEnabled() and collateCopies().
[править] bool QPrinter::isOptionEnabled ( PrinterOption option ) const
Use QPrintDialog instead.
[править] void QPrinter::margins ( uint * top, uint * left, uint * bottom, uint * right ) const
Sets *top, *left, *bottom, *right to be the top, left, bottom, and right margins.
This function has been superseded by paperRect() and pageRect(). Use paperRect().top() - pageRect().top() for the top margin, paperRect(). left() - pageRect(). left() for the left margin, paperRect().bottom() - pageRect().bottom() for the bottom margin, and papaerRect(). right() - pageRect(). right() for the right margin.
Например, если у вас есть код
uint rightMargin; uint bottomMargin; printer->margins(0, 0, &bottomMargin, &rightMargin);
вы можете записать его в виде
int rightMargin = printer->paperRect().right() - printer->pageRect().right(); int bottomMargin = printer->paperRect().bottom() - printer->pageRect().bottom();
[править] QSize QPrinter::margins () const
Эта перегруженная функция предоставлена для удобства.
Returns a QSize containing the left margin and the top margin.
This function has been superseded by paperRect() and pageRect(). Use paperRect(). left() - pageRect(). left() for the left margin, and paperRect().top() - pageRect().top() for the top margin.
Например, если у вас есть код
QSize margins = printer->margins(); int leftMargin = margins.width(); int topMargin = margins.height();
вы можете записать его в виде
int leftMargin = printer->paperRect().left() - printer->pageRect().left(); int topMargin = printer->paperRect().top() - printer->pageRect().top();
[править] int QPrinter::maxPage () const
Use QPrintDialog::maxPage() instead.
[править] int QPrinter::minPage () const
Use QPrintDialog::minPage() instead.
[править] bool QPrinter::outputToFile () const
Returns true if the output should be written to a file, or false if the output should be sent directly to the printer. The default setting is false.
See also setOutputToFile() and setOutputFileName().
[править] bool QPrinter::pageSetup ( QWidget * parent = 0 )
Executes a page setup dialog so that the user can configure the type of page used for printing. Returns true if the contents of the dialog are accepted; returns false if the dialog is canceled.
[править] bool QPrinter::printSetup ( QWidget * parent = 0 )
Executes a print setup dialog so that the user can configure the printing process. Returns true if the contents of the dialog are accepted; returns false if the dialog is canceled.
[править] void QPrinter::setCollateCopiesEnabled ( bool enable )
Use QPrintDialog::addEnabledOption( QPrintDialog::PrintCollateCopies) or QPrintDialog::setEnabledOptions( QPrintDialog::enabledOptions() & ~ QPrintDialog::PrintCollateCopies) instead, depending on enable.
See also collateCopiesEnabled().
[править] void QPrinter::setMinMax ( int minPage, int maxPage )
Use QPrintDialog::setMinMax() instead.
[править] void QPrinter::setOptionEnabled ( PrinterOption option, bool enable )
Use QPrintDialog instead.
See also isOptionEnabled().
[править] void QPrinter::setOutputToFile ( bool enable )
Specifies whether the output should be written to a file or sent directly to the printer.
Will output to a file if enable is true, or will output directly to the printer if enable is false.
See also outputToFile() and setOutputFileName().
[править] bool QPrinter::setup ( QWidget * parent = 0 )
Use QPrintDialog instead.
Например, если у вас есть код
if (printer->setup(parent)) ...
вы можете записать его в виде
QPrintDialog dialog(printer, parent); if (dialog.exec()) ...
Copyright © 2007 Trolltech | Trademarks | Qt 4.3.2
|