Remove QPageSetupWidget::selectPrinter
t's only ever called after setPrinter so merge the code Change-Id: I4b5d593edbe62b64354e81c19112fa87b0555fdc Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
072dd59de7
commit
ceccdff4e9
@ -210,7 +210,7 @@ void QUnixPageSetupDialogPrivate::init()
|
||||
Q_Q(QPageSetupDialog);
|
||||
|
||||
widget = new QPageSetupWidget(q);
|
||||
widget->setPrinter(printer);
|
||||
widget->setPrinter(printer, printer->outputFormat(), printer->printerName());
|
||||
|
||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||
| QDialogButtonBox::Cancel,
|
||||
@ -371,7 +371,7 @@ void QPageSetupWidget::initPageSizes()
|
||||
|
||||
// Set the dialog to use the given QPrinter
|
||||
// Usually only called on first creation
|
||||
void QPageSetupWidget::setPrinter(QPrinter *printer)
|
||||
void QPageSetupWidget::setPrinter(QPrinter *printer, QPrinter::OutputFormat outputFormat, const QString &printerName)
|
||||
{
|
||||
m_printer = printer;
|
||||
|
||||
@ -387,14 +387,6 @@ void QPageSetupWidget::setPrinter(QPrinter *printer)
|
||||
m_units = m_pageLayout.units();
|
||||
m_pagePreview->setPageLayout(m_pageLayout);
|
||||
|
||||
// Then update the widget with the current printer details
|
||||
selectPrinter(m_printer->outputFormat(), m_printer->printerName());
|
||||
}
|
||||
|
||||
// The printer selected in the QPrintDialog has been changed, update the widget to reflect this
|
||||
// Note the QPrinter is not updated at this time in case the user presses the Cancel button in QPrintDialog
|
||||
void QPageSetupWidget::selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName)
|
||||
{
|
||||
m_outputFormat = outputFormat;
|
||||
m_printerName = printerName;
|
||||
initPageSizes();
|
||||
|
@ -72,8 +72,7 @@ public:
|
||||
explicit QPageSetupWidget(QWidget *parent = 0);
|
||||
explicit QPageSetupWidget(QPrinter *printer, QWidget *parent = 0);
|
||||
|
||||
void setPrinter(QPrinter *printer);
|
||||
void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);
|
||||
void setPrinter(QPrinter *printer, QPrinter::OutputFormat outputFormat, const QString &printerName);
|
||||
void setupPrinter() const;
|
||||
|
||||
private slots:
|
||||
|
@ -248,8 +248,7 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrinter::Outp
|
||||
connect(m_buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
|
||||
connect(m_buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
|
||||
|
||||
widget.pageSetup->setPrinter(printer);
|
||||
widget.pageSetup->selectPrinter(outputFormat, printerName);
|
||||
widget.pageSetup->setPrinter(printer, outputFormat, printerName);
|
||||
|
||||
#if QT_CONFIG(cupsjobwidget)
|
||||
m_jobOptions = new QCupsJobWidget(printer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user