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

Crash when printing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.3.2
    • GUI: Printing
    • None
    • Windows 11, Visual Studio 2022
    • Windows

    Description

      This little program crashes in the QPainter constructor:

      QPrinter printer;
      QPrintDialog pd(&printer);
      if (pd.exec() == QDialog::Accepted)
      {
          QPainter painter(&printer); //crash!
          painter.drawLine(10, 10, 20, 20);
      }

      If I configure the printer to save a PDF file (QPrinter::setOutputFileName), it works.

      I have tested selecting the the "Microsof Print to PDF" or the "Microsoft XPS document Writer" printers in the native print dialog. The program crashes after selecting the save file path. Actually I can't test it with a "real" printer.

       

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            puffosauro Fabio Dago
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes