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

Crash when printing

XMLWordPrintable

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

      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.

       

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes