Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101507

QPageSetupDialog::open doesn't update QPrinter, unlike exec()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: GUI: Printing
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      void PrintSettingsWidget::openPrinterPropertiesDialog()
      {
      	auto *dlg = new QPageSetupDialog(&m_printer, this);
      	dlg->setWindowModality(Qt::ApplicationModal);
      	dlg->open(this, SLOT(propertiesDialogAccepted()));
      }
      
      void PrintSettingsWidget::propertiesDialogAccepted()
      {
      	qDebug() << m_printer.printerName() << "margins" << m_printer.pageLayout().margins();
      }
      

      shows that the printer name is updated by the page setup dialog, but not the margins.
      That's because the margins get saved into m_pageLayout, but this is copied into the QPrinter only by setupPrinter(), called by QPageSetupDialog::exec() in qpagesetupdialog_unix.cpp

      The implementation of open() is generic and misses that code.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            johnlayt John Layt
            Reporter:
            dfaure_kdab David Faure
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes