PySide.QtGui.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, PySide.QtGui.QPrintDialog objects are constructed with a PySide.QtGui.QPrinter object, and executed using the exec() 函数。
printDialog = QPrintDialog(printer, parent)
if printDialog.exec_() == QDialog.Accepted:
# print ...
If the dialog is accepted by the user, the PySide.QtGui.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 特性 push button.
On Windows and Mac OS X, the native print dialog is used, which means that some PySide.QtGui.QWidget and PySide.QtGui.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. PySide.QtGui.QPrintDialog.setOptions() and PySide.QtGui.QPrintDialog.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() .
另请参阅
PySide.QtGui.QPageSetupDialog PySide.QtGui.QPrinter 像素器范例 订购表单范例 图像查看器范例 涂鸦范例
| 参数: |
|
|---|
Constructs a new modal printer dialog for the given printer 采用给定 parent .
Constructs a print dialog with the given parent .
| 参数: | printer – PySide.QtGui.QPrinter |
|---|
| 参数: |
|
|---|
这是重载函数。
打开对话框并连接其 PySide.QtGui.QPrintDialog.accepted() signal to the slot specified by receiver and member .
信号将断开槽连接,当对话框被关闭时。
| 返回类型: | PySide.QtGui.QAbstractPrintDialog.PrintDialogOptions |
|---|
This property holds the various options that affect the look and feel of the dialog.
默认情况下,所有选项是被禁用的。
Options should be set before showing the dialog. Setting them while the dialog is visible is not guaranteed to have an immediate effect on the dialog (depending on the option and on the platform).
| 参数: |
|
|---|
设置给定 option to be enabled if on is true; otherwise, clears the given option .
| 参数: | options – PySide.QtGui.QAbstractPrintDialog.PrintDialogOptions |
|---|
This property holds the various options that affect the look and feel of the dialog.
默认情况下,所有选项是被禁用的。
Options should be set before showing the dialog. Setting them while the dialog is visible is not guaranteed to have an immediate effect on the dialog (depending on the option and on the platform).
| 参数: | option – PySide.QtGui.QAbstractPrintDialog.PrintDialogOption |
|---|---|
| 返回类型: | PySide.QtCore.bool |
Returns true if the given option 被启用;否则,返回 false。