Use QPageSetupDialog dialog for "Print to pdf" mode.
--HG-- branch : develop
This commit is contained in:
parent
c326a4cd75
commit
fb39798b3c
|
@ -385,12 +385,14 @@ void TableWindow::LayoutPrint()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TableWindow::PrintToPdf()
|
void TableWindow::PrintToPdf()
|
||||||
{
|
{
|
||||||
// display print dialog and if accepted print
|
|
||||||
QPrinter printer;
|
QPrinter printer;
|
||||||
printer.setCreator(qApp->applicationDisplayName()+" "+qApp->applicationVersion());
|
printer.setCreator(qApp->applicationDisplayName()+" "+qApp->applicationVersion());
|
||||||
printer.setDocName(fileName);
|
printer.setDocName(fileName);
|
||||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
|
||||||
|
|
||||||
|
QPageSetupDialog dialog(&printer, this);
|
||||||
|
if ( dialog.exec() == QDialog::Accepted )
|
||||||
|
{
|
||||||
|
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||||
const QString fileName = QFileDialog::getSaveFileName(this, tr("Print to pdf"),
|
const QString fileName = QFileDialog::getSaveFileName(this, tr("Print to pdf"),
|
||||||
QDir::homePath()+"/"+this->fileName+".pdf",
|
QDir::homePath()+"/"+this->fileName+".pdf",
|
||||||
tr("PDF file (*.pdf)"));
|
tr("PDF file (*.pdf)"));
|
||||||
|
@ -401,6 +403,7 @@ void TableWindow::PrintToPdf()
|
||||||
Print( &printer );
|
Print( &printer );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TableWindow::Layout()
|
void TableWindow::Layout()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user