Spreadsheet: fix format of table cells when used for printing, by default use landscape orientation

This commit is contained in:
wmayer
2021-12-05 12:16:54 +01:00
parent 1d3822822d
commit 45de32c4e1
2 changed files with 67 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ bool SheetView::onHasMsg(const char *pMsg) const
void SheetView::print()
{
QPrinter printer(QPrinter::ScreenResolution);
printer.setOrientation(QPrinter::Landscape);
printer.setFullPage(true);
QPrintDialog dlg(&printer, this);
if (dlg.exec() == QDialog::Accepted) {
@@ -236,6 +237,7 @@ void SheetView::print()
void SheetView::printPreview()
{
QPrinter printer(QPrinter::ScreenResolution);
printer.setOrientation(QPrinter::Landscape);
QPrintPreviewDialog dlg(&printer, this);
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),
this, SLOT(print(QPrinter *)));
@@ -261,6 +263,7 @@ void SheetView::printPdf()
QString::fromLatin1("%1 (*.pdf)").arg(tr("PDF file")));
if (!filename.isEmpty()) {
QPrinter printer(QPrinter::ScreenResolution);
printer.setOrientation(QPrinter::Landscape);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(filename);
print(&printer);