|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QDialog
com.trolltech.qt.gui.QAbstractPrintDialog
com.trolltech.qt.gui.QPrintDialog
public class QPrintDialog
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 = new QPrintDialog(printer, parent); if (printDialog.exec() == QDialog.DialogCode.Accepted.value()) { // print ... }If the dialog is accepted by the user, the
QPrinter
object is correctly configured for printing.
![]() |
![]() |
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. QAbstractPrintDialog::setEnabledOptions() and QAbstractPrintDialog::addEnabledOption() have no effect.
In Qt 4.4, it was possible to use the satic 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().
QPageSetupDialog
, QPrinter
, Pixelator Example, Order Form Example, Image Viewer Example, and Scribble Example.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAbstractPrintDialog |
---|
QAbstractPrintDialog.PrintDialogOption, QAbstractPrintDialog.PrintDialogOptions, QAbstractPrintDialog.PrintRange |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QDialog |
---|
QDialog.DialogCode |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
accepted
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.gui.QDialog |
---|
finished, rejected |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QPrintDialog()
Constructs a print dialog with the given parent. |
|
QPrintDialog(QPrinter printer)
Constructs a new modal printer dialog for the given printer with the given parent. |
|
QPrintDialog(QPrinter printer,
QWidget parent)
Constructs a new modal printer dialog for the given printer with the given parent. |
|
QPrintDialog(QWidget parent)
Constructs a print dialog with the given parent. |
Method Summary | |
---|---|
QAbstractPrintDialog.PrintDialogOptions |
options()
This property holds the various options that affect the look and feel of the dialog. |
void |
setOption(QAbstractPrintDialog.PrintDialogOption option)
Sets the given option to be enabled if on is true; otherwise, clears the given option. |
void |
setOption(QAbstractPrintDialog.PrintDialogOption option,
boolean on)
Sets the given option to be enabled if on is true; otherwise, clears the given option. |
void |
setOptions(QAbstractPrintDialog.PrintDialogOption[] options)
This is an overloaded method provided for convenience. |
void |
setOptions(QAbstractPrintDialog.PrintDialogOptions options)
This property holds the various options that affect the look and feel of the dialog. |
boolean |
testOption(QAbstractPrintDialog.PrintDialogOption option)
Returns true if the given option is enabled; otherwise, returns false. |
Methods inherited from class com.trolltech.qt.gui.QAbstractPrintDialog |
---|
addEnabledOption, enabledOptions, fromPage, isOptionEnabled, maxPage, minPage, printer, printRange, setEnabledOptions, setEnabledOptions, setFromTo, setMinMax, setOptionTabs, setPrintRange, toPage |
Methods inherited from class com.trolltech.qt.gui.QDialog |
---|
accept, done, exec, isSizeGripEnabled, open, reject, result, setModal, setResult, setSizeGripEnabled |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 accepted
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QPrinter(named: printer)>:
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.
Constructor Detail |
---|
public QPrintDialog(QPrinter printer)
public QPrintDialog(QPrinter printer, QWidget parent)
public QPrintDialog()
public QPrintDialog(QWidget parent)
Method Detail |
---|
public final QAbstractPrintDialog.PrintDialogOptions options()
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).
setOption()
, and testOption()
.
public final void setOption(QAbstractPrintDialog.PrintDialogOption option)
options
, and testOption()
.
public final void setOption(QAbstractPrintDialog.PrintDialogOption option, boolean on)
options
, and testOption()
.
public final void setOptions(QAbstractPrintDialog.PrintDialogOption[] options)
public final void setOptions(QAbstractPrintDialog.PrintDialogOptions options)
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).
setOption()
, and testOption()
.
public final boolean testOption(QAbstractPrintDialog.PrintDialogOption option)
options
, and setOption()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |