Qt 5.5 print bug on Windows?

  • Hi,

    the application I work on crashes on Windows if I

    • print a page
    • choose the 'Microsoft XPS Document Writer' printer and
    • press the button cancel when the system asks me the name of the XPS file

    At first I thought the error was in my application but I found that the same happens in QtCreator.
    In my case the crash happens in the slot connected to the signal paintRequested() of my QPrintPreviewWidget subclass:

    void LabelsPrintPreviewWidget::printLabels(QPrinter *printer)
        if (!printer->isValid())
        QPainter painter(printer);    <- HERE 

    The dialog to choose the name of the XPS file is shown when the line QPainter painter(printer); is executed and if I click on the Cancel button the application crashes.

    Does anybody know if this an error in my application (and QtCreator) or is it a bug in Qt 5.5 (on Windows)?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If you can reproduce this with a minimal compilable example then it's likely a bug. You should check the bug report system to see if it's something known.

  • Thanks SGaist,

    I searched in the bug report system but did not find a similar issue so I submitted a new bug report (QTBUG-48203).

  • Lifetime Qt Champion

    Thanks for sharing the link

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.