From 77cd033e44f9b899749994b17fc0bbfa7a164a3b Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 8 Dec 2013 00:16:45 +0100 Subject: 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 --- src/printsupport/dialogs/qprintdialog.h | 1 - src/printsupport/dialogs/qprintdialog_unix.cpp | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h index c822aa0533..886cd1e08d 100644 --- a/src/printsupport/dialogs/qprintdialog.h +++ b/src/printsupport/dialogs/qprintdialog.h @@ -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) diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index fe7e43814c..41a01abf3b 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -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) -- cgit v1.2.3