QPrintDialog Class Reference
|
| QPrintDialog ( QPrinter * printer, QWidget * parent = 0 ) | |
| QPrintDialog ( QWidget * parent = 0 ) | |
| ~QPrintDialog () | |
| void | open ( QObject * receiver, const char * member ) |
| PrintDialogOptions | options () const |
| QPrinter * | printer () |
| void | setOption ( PrintDialogOption option, bool on = true ) |
| void | setOptions ( PrintDialogOptions options ) |
| bool | testOption ( PrintDialogOption option ) const |
| virtual void | done ( int result ) |
| virtual int | exec () |
| virtual void | setVisible ( bool visible ) |
| void | accepted ( QPrinter * printer ) |
The QPrintDialog class provides a dialog for specifying the printer's configuration.
The dialog allows users to change document-related settings, such as the paper size and orientation, type of print (color or grayscale), range of pages, and number of copies to print.
Controls are also provided to enable users to choose from the printers available, including any configured network printers.
Typically, QPrintDialog objects are constructed with a QPrinter object, and executed using the exec() function.
QPrintDialog printDialog(printer, parent);
if (printDialog.exec() == QDialog::Accepted) {
// print ...
}
If the dialog is accepted by the user, the QPrinter object is correctly configured for printing.
|
|
|
The printer dialog (shown above in Plastique style) enables access to common printing properties. On X11 platforms that use the CUPS printing system, the settings for each available printer can be modified via the dialog's Properties push button.
On Windows and Mac OS X, the native print dialog is used, which means that some QWidget and QDialog properties set on the dialog won't be respected. The native print dialog on Mac OS X does not support setting printer options, i.e. setOptions() and setOption() have no effect.
In Qt 4.4, it was possible to use the static functions to show a sheet on Mac OS X. This is no longer supported in Qt 4.5. If you want this functionality, use QPrintDialog::open().
See also QPageSetupDialog, QPrinter, Pixelator Example, Order Form Example, Image Viewer Example, and Scribble Example.
Это свойство содержит различные опции, которые влияют на внешний вид и поведение диалога.
По умолчанию все опции отключены.
Опции должны быть установлены до показа диалога. Их установка пока диалог видим не гарантирует немедленного эффекта на диалоге (зависит от опции и платформы).
Это свойство было введено в Qt 4.5.
Функции доступа:
| PrintDialogOptions | options () const |
| void | setOptions ( PrintDialogOptions options ) |
Смотрите также setOption() и testOption().
Constructs a new modal printer dialog for the given printer with the given parent.
Constructs a print dialog with the given parent.
Destroys the print dialog.
This signal is emitted when the user accepts the values set in the print dialog. The printer parameter includes the printer that the settings were applied to.
Повторно реализовано из QDialog::done().
Закрывает диалог и устанавливает его код результата в result. Если этот диалог показывается с помощью exec(), done() вызывает завершение локального цикла обработки событий, а exec(), чтобы вернуть result.
Смотрите также QDialog::done().
Reimplemented from QAbstractPrintDialog::exec().
Это перегруженная функция.
Opens the dialog and connects its accepted() signal to the slot specified by receiver and member.
Сигнал будет отсоединен от слота когда диалог закрывается.
Эта функция была введена в Qt 4.5.
Returns the printer that this printer dialog operates on. This can be useful when using the QPrintDialog::open() method.
See also setPrinter().
Устанавливает заданную опцию option включённой если on равно true; в противном случае очищает заданную опцию option.
Смотрите также options и testOption().
Повторно реализовано из QWidget::setVisible().
Возвращает true если заданная опция option включена; в противном случае возвращается false.
Смотрите также options и setOption().
| Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) | Торговые марки | Qt 4.6.4 |
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |