diff --git a/src/lib/webengine/webview.cpp b/src/lib/webengine/webview.cpp index 5f328ae42..0e960a39e 100644 --- a/src/lib/webengine/webview.cpp +++ b/src/lib/webengine/webview.cpp @@ -392,14 +392,16 @@ void WebView::printPage() { Q_ASSERT(m_page); - QPrintDialog* dialog = new QPrintDialog(this); + QPrinter *printer = new QPrinter(); + printer->setCreator(tr("Falkon %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS)); + printer->setDocName(QzTools::filterCharsFromFilename(title())); + + QPrintDialog *dialog = new QPrintDialog(printer, this); dialog->setOptions(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintShowPageSize); #ifndef Q_OS_WIN dialog->setOption(QAbstractPrintDialog::PrintPageRange); dialog->setOption(QAbstractPrintDialog::PrintCollateCopies); #endif - dialog->printer()->setCreator(tr("Falkon %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS)); - dialog->printer()->setDocName(QzTools::getFileNameFromUrl(url())); if (dialog->exec() == QDialog::Accepted) { if (dialog->printer()->outputFormat() == QPrinter::PdfFormat) {