Enabled basic print code for Summary tab

This commit is contained in:
Mark Watkins 2011-12-26 03:12:54 +10:00
parent 410f0cdf51
commit cd637c4356

View File

@ -1213,9 +1213,25 @@ void MainWindow::on_actionPrint_Report_triggered()
if (oximetry) if (oximetry)
PrintReport(oximetry->graphView(),STR_TR_Oximetry); PrintReport(oximetry->graphView(),STR_TR_Oximetry);
} else { } else {
//QPrinter printer(); QPrinter printer;
//ui->webView->print(printer) #ifdef Q_WS_X11
QMessageBox::information(this,tr("Not supported Yet"),tr("Sorry, printing from this page is not supported yet"),QMessageBox::Ok); printer.setPrinterName("Print to File (PDF)");
printer.setOutputFormat(QPrinter::PdfFormat);
QString filename=PREF.Get("{home}/Summary_"+PROFILE.user->userName()+"_"+QDate::currentDate().toString(Qt::ISODate)+".pdf");
printer.setOutputFileName(filename);
#endif
printer.setPrintRange(QPrinter::AllPages);
printer.setOrientation(QPrinter::Portrait);
printer.setFullPage(false); // This has nothing to do with scaling
printer.setNumCopies(1);
printer.setPageMargins(10,10,10,10,QPrinter::Millimeter);
QPrintDialog pdlg(&printer,this);
if (pdlg.exec()==QPrintDialog::Accepted) {
ui->summaryView->print(&printer);
}
//QMessageBox::information(this,tr("Not supported Yet"),tr("Sorry, printing from this page is not supported yet"),QMessageBox::Ok);
} }
} }