mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 04:33:03 +03:00
Preview printer initialization changed
This commit is contained in:
parent
83a57b5cbe
commit
b74a72531c
@ -213,29 +213,29 @@ void PreviewReportWidget::printPages(QPrinter* printer)
|
||||
|
||||
void PreviewReportWidget::print()
|
||||
{
|
||||
if (m_defaultPrinter){
|
||||
printPages(m_defaultPrinter);
|
||||
} else {
|
||||
QPrinterInfo pi;
|
||||
QPrinter lp(QPrinter::HighResolution);
|
||||
|
||||
QPrinterInfo pi;
|
||||
QPrinter printer(QPrinter::HighResolution);
|
||||
|
||||
if (!pi.defaultPrinter().isNull())
|
||||
if (!pi.defaultPrinter().isNull()){
|
||||
#ifdef HAVE_QT4
|
||||
printer.setPrinterName(pi.defaultPrinter().printerName());
|
||||
lp.setPrinterName(pi.defaultPrinter().printerName());
|
||||
#endif
|
||||
#ifdef HAVE_QT5
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||
printer.setPrinterName(pi.defaultPrinterName());
|
||||
lp.setPrinterName(pi.defaultPrinterName());
|
||||
#else
|
||||
printer.setPrinterName(pi.defaultPrinter().printerName());
|
||||
lp.setPrinterName(pi.defaultPrinter().printerName());
|
||||
#endif
|
||||
#endif
|
||||
QPrintDialog dialog(&printer,QApplication::activeWindow());
|
||||
if (dialog.exec()==QDialog::Accepted){
|
||||
printPages(&printer);
|
||||
}
|
||||
}
|
||||
|
||||
QPrinter* printer = m_defaultPrinter ? m_defaultPrinter : &lp;
|
||||
|
||||
QPrintDialog dialog(printer,QApplication::activeWindow());
|
||||
if (dialog.exec()==QDialog::Accepted){
|
||||
printPages(printer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PreviewReportWidget::printToPDF()
|
||||
|
Loading…
Reference in New Issue
Block a user