Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.0.2, 5.1.1
-
None
-
Mac version 10.7.5
Description
QPrintDialog doesn't set the outputFileName of the QPrinter if the user selects "Save as PDF" even though in qprintdialog_mac.mm it appears to record the name.
As a secondary note, it also does not change the outputFormat to PdfFormat. I can see this being debatable but not so much the file name.
Minimal test case:
================= MacPDF.pro ================
QT += core gui printsupport
TARGET = MacPDF
TEMPLATE = app
SOURCES += main.cpp
=============================================
================= main.cpp ==================
#include <QApplication>
#include <QDebug>
#include <QtPrintSupport/QPrinter>
#include <QtPrintSupport/QPrintDialog>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPrinter printer(QPrinter::HighResolution);
QPrintDialog dlg(&printer);
if (dlg.exec() == QDialog::Accepted)
{
qDebug() << "File name:" << printer.outputFileName();
if (printer.outputFormat() == QPrinter::PdfFormat)
qDebug() << "Format: PDF";
if (printer.outputFormat() == QPrinter::NativeFormat)
qDebug() << "Format: Native";
}
}
=============================================
Attachments
Issue Links
- is required for
-
QTBUG-25379 QtPrintSupport - PDF Issues
- Open
-
QTBUG-25383 QtPrintSupport - macOS Issues
- Closed