46 #include "private/qprinter_p.h" 48 #ifndef QT_NO_PRINTDIALOG 126 d->setPrinter(printer);
139 d->setPrinter(printer);
161 if (!(
d->pd->options & option) != !on)
162 setOptions(
d->pd->options ^ option);
174 return (
d->pd->options & option) != 0;
197 PrintDialogOptions changed = (options ^
d->pd->options);
201 d->pd->options = options;
207 return d->pd->options;
221 d->pd->options = options;
235 d->pd->options |= option;
249 return d->pd->options;
263 return d->pd->options & option;
272 d->pd->printRange = range;
281 return d->pd->printRange;
291 Q_ASSERT_X(min <= max,
"QAbstractPrintDialog::setMinMax",
292 "'min' must be less than or equal to 'max'");
293 d->pd->minPage = min;
294 d->pd->maxPage = max;
305 return d->pd->minPage;
316 return d->pd->maxPage;
325 Q_ASSERT_X(from <= to,
"QAbstractPrintDialog::setFromTo",
326 "'from' must be less than or equal to 'to'");
327 d->pd->fromPage = from;
330 if (
d->pd->minPage == 0 &&
d->pd->maxPage == 0)
341 return d->pd->fromPage;
351 return d->pd->toPage;
509 if (
d->receiverToDisconnectOnClose) {
511 d->receiverToDisconnectOnClose,
d->memberToDisconnectOnClose);
512 d->receiverToDisconnectOnClose = 0;
514 d->memberToDisconnectOnClose.clear();
533 d->receiverToDisconnectOnClose = receiver;
534 d->memberToDisconnectOnClose = member;
540 #endif // QT_NO_PRINTDIALOG
QAbstractPrintDialog(QPrinter *printer, QWidget *parent=0)
Constructs an abstract print dialog for printer with parent as parent widget.
bool testOption(PrintDialogOption option) const
Returns true if the given option is enabled; otherwise, returns false.
#define QT_END_NAMESPACE
This macro expands to.
The QDialog class is the base class of dialog windows.
bool isOptionEnabled(PrintDialogOption option) const
Use QPrintDialog::testOption(option) instead.
void setOptionTabs(const QList< QWidget *> &tabs)
Set a list of widgets as tabs to be shown on the print dialog, if supported.
PrintDialogOptions options() const
The QObject class is the base class of all Qt objects.
int minPage() const
Returns the minimum page in the page range.
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
The QPrintDialog class provides a dialog for specifying the printer's configuration.
QPrinter * printer() const
Returns the printer that this printer dialog operates on.
PrintRange
Used to specify the print range selection option.
void setOptions(PrintDialogOptions options)
void setMinMax(int min, int max)
Sets the page range in this dialog to be from min to max.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
PrintDialogOption
Used to specify which parts of the print dialog should be visible.
The QPrinter class is a paint device that paints on a printer.
PrintRange printRange() const
Returns the print range.
int fromPage() const
Returns the first page to be printed By default, this value is set to 0.
int toPage() const
Returns the last page to be printed.
void setFromTo(int fromPage, int toPage)
Sets the range in the print dialog to be from from to to.
const T * ptr(const T &t)
int maxPage() const
Returns the maximum page in the page range.
void done(int result)
Closes the dialog and sets its result code to result.
virtual void done(int)
Closes the dialog and sets its result code to r.
void setEnabledOptions(PrintDialogOptions options)
Use QPrintDialog::setOptions() instead.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
#define Q_ASSERT_X(cond, where, what)
The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure pri...
QObject * parent() const
Returns a pointer to the parent object.
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
void accepted()
This signal is emitted when the dialog has been accepted either by the user or by calling accept() or...
void setOption(PrintDialogOption option, bool on=true)
Sets the given option to be enabled if on is true; otherwise, clears the given option.
void setPrintRange(PrintRange range)
Sets the print range option in to be range.
void open()
Shows the dialog as a window modal dialog, returning immediately.
void addEnabledOption(PrintDialogOption option)
Use QPrintDialog::setOption(option, true) instead.
PrintDialogOptions enabledOptions() const
Use QPrintDialog::options() instead.
void setPrinter(QPrinter *newPrinter)