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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • GUI: Printing
    • None
    • 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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            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