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

QPrintDialog::accept() does not work, if page ranges are entered (Linux)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.3
    • GUI: Printing
    • None
    • Linux/X11

    Description

      QPrintDialog::accept() does not work, if page ranges are entered on platform Linux (apparently since 6.0). Reason is a wrong sequence of instructions: 'printer()->pageRanges().isEmpty()' returns a wrong result, if 'd->setupPrinter()' is not called before.

      qprintdialog_unix.cpp:

      void QPrintDialog::accept()
      {
          Q_D(QPrintDialog);
      #if QT_CONFIG(cups)
          if (d->options.pagesRadioButton->isChecked() && printer()->pageRanges().isEmpty()) {
              QMessageBox::critical(this, tr("Invalid Pages Definition"),
                                    tr("%1 does not follow the correct syntax. Please use ',' to separate "
                                    "ranges and pages, '-' to define ranges and make sure ranges do "
                                    "not intersect with each other.").arg(d->options.pagesLineEdit->text()),
                                    QMessageBox::Ok, QMessageBox::Ok);
              return;
          }
          if (d->top->d->m_duplexPpdOption && d->top->d->m_duplexPpdOption->conflicted) {
              const QMessageBox::StandardButton answer = QMessageBox::warning(this, tr("Duplex Settings Conflicts"),
                                                                              tr("There are conflicts in duplex settings. Do you want to fix them?"),
                                                                              QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
              if (answer != QMessageBox::No)
                  return;
          }
      #endif
          d->setupPrinter();
          QDialog::accept();
      }
      

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            wschenke Winfried Schenke
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes