QPrintDialog - Fix setting of PageOrder
The print dialog was setting the PageOrder on the QPrinter as soon as the check box was toggled and not when the Print button was pressed, meaning the change is not forgotten when Cancel is pressed. Change-Id: I19637b7efacfb5388c70d2e7d9d05a05ecc5b2ea Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
5bf67f5f41
commit
77cd033e44
@ -106,7 +106,6 @@ Q_SIGNALS:
|
||||
|
||||
private:
|
||||
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_togglePageSetCombo(bool))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog())
|
||||
# if !defined(QT_NO_MESSAGEBOX)
|
||||
|
@ -203,7 +203,6 @@ public:
|
||||
|
||||
void selectPrinter(const QPrinter::OutputFormat outputFormat);
|
||||
|
||||
void _q_chbPrintLastFirstToggled(bool);
|
||||
void _q_togglePageSetCombo(bool);
|
||||
#ifndef QT_NO_MESSAGEBOX
|
||||
void _q_checkFields();
|
||||
@ -363,9 +362,6 @@ void QPrintDialogPrivate::init()
|
||||
#endif
|
||||
QObject::connect(buttons, SIGNAL(rejected()), q, SLOT(reject()));
|
||||
|
||||
QObject::connect(options.reverse, SIGNAL(toggled(bool)),
|
||||
q, SLOT(_q_chbPrintLastFirstToggled(bool)));
|
||||
|
||||
QObject::connect(options.printSelection, SIGNAL(toggled(bool)),
|
||||
q, SLOT(_q_togglePageSetCombo(bool)));
|
||||
|
||||
@ -429,6 +425,7 @@ void QPrintDialogPrivate::setupPrinter()
|
||||
}
|
||||
|
||||
p->setColorMode(options.color->isChecked() ? QPrinter::Color : QPrinter::GrayScale);
|
||||
p->setPageOrder(options.reverse->isChecked() ? QPrinter::LastPageFirst : QPrinter::FirstPageFirst);
|
||||
|
||||
// print range
|
||||
if (options.printAll->isChecked()) {
|
||||
@ -486,15 +483,6 @@ void QPrintDialogPrivate::setupPrinter()
|
||||
top->d->setupPrinter();
|
||||
}
|
||||
|
||||
void QPrintDialogPrivate::_q_chbPrintLastFirstToggled(bool checked)
|
||||
{
|
||||
Q_Q(QPrintDialog);
|
||||
if (checked)
|
||||
q->printer()->setPageOrder(QPrinter::LastPageFirst);
|
||||
else
|
||||
q->printer()->setPageOrder(QPrinter::FirstPageFirst);
|
||||
}
|
||||
|
||||
void QPrintDialogPrivate::_q_togglePageSetCombo(bool checked)
|
||||
{
|
||||
if (printerOutputFormat == QPrinter::PdfFormat)
|
||||
|
Loading…
Reference in New Issue
Block a user