本文整理汇总了C++中ORPrintRender::setPrinter方法的典型用法代码示例。如果您正苦于以下问题:C++ ORPrintRender::setPrinter方法的具体用法?C++ ORPrintRender::setPrinter怎么用?C++ ORPrintRender::setPrinter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORPrintRender
的用法示例。
在下文中一共展示了ORPrintRender::setPrinter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print
void RenderWindow::print(bool showPreview, int numCopies )
{
ORPreRender pre;
pre.setDom(_doc);
pre.setParamList(getParameterList());
ORODocument * doc = pre.generate();
if(doc)
{
QPrinter printer(QPrinter::HighResolution);
#if QT_VERSION < 0x040700 // if qt < 4.7.0 then use the old function call.
printer.setNumCopies( numCopies );
#else
printer.setCopyCount( numCopies );
#endif
if(!_printerName.isEmpty())
{
printer.setPrinterName(_printerName);
_printerName = QString::null;
}
ORPrintRender render;
render.setupPrinter(doc, &printer);
if(showPreview)
{
if(printer.printerName().isEmpty())
{
QPrintDialog pd(&printer);
if(pd.exec() != QDialog::Accepted)
{
return; // no printer, can't preview
}
}
PreviewDialog preview (doc, &printer, this);
if (preview.exec() == QDialog::Rejected)
return;
}
if(_autoPrint)
{
render.setPrinter(&printer);
render.render(doc);
}
else
{
QPrintDialog pd(&printer);
pd.setMinMax(1, doc->pages());
if(pd.exec() == QDialog::Accepted)
{
render.setPrinter(&printer);
render.render(doc);
}
}
delete doc;
}
}
示例2: exportToPDF
bool orReport::exportToPDF( const QString& fileName )
{
if ( !isValid() )
return false;
ORODocument * doc = _internal->_prerenderer.generate();
if(doc)
{
QString localFileName = fileName;
QPrinter printer( QPrinter::HighResolution );
if (! localFileName.endsWith(".pdf", Qt::CaseInsensitive))
localFileName.append(".pdf");
printer.setOutputFileName( localFileName );
#ifdef Q_WS_MAC
printer.setOutputFormat( QPrinter::NativeFormat );
#else
printer.setOutputFormat( QPrinter::PdfFormat );
#endif
ORPrintRender render;
render.setupPrinter(doc, &printer);
render.setPrinter(&printer);
return render.render(doc);
}
return false;
}
示例3: render
bool orReport::render(QPainter *pPainter, QPrinter *pPrinter)
{
QApplication::setOverrideCursor( Qt::WaitCursor );
bool retval = false;
if(_internal != 0 && pPrinter != 0)
{
ORODocument * doc = _internal->_genDoc;
if(doc == 0)
doc = _internal->_prerenderer.generate();
if(doc)
{
ORPrintRender render;
render.setPrinter(pPrinter);
render.setPainter(pPainter);
retval = render.render(doc);
}
}
else
{
// rendering to a non print device isn't supported at this time
qDebug("Trying to render to a non print device");
}
QApplication::restoreOverrideCursor();
return retval;
}
示例4: print
void RenderWindow::print(bool showPreview)
{
ORPreRender pre;
pre.setDom(_doc);
pre.setParamList(getParameterList());
ORODocument * doc = pre.generate();
if(doc)
{
QPrinter printer(QPrinter::HighResolution);
if(!_printerName.isEmpty())
{
printer.setPrinterName(_printerName);
_printerName = QString::null;
}
if(showPreview)
{
PreviewDialog preview (doc, &printer, this);
if (preview.exec() == QDialog::Rejected)
return;
}
ORPrintRender render;
render.setupPrinter(doc, &printer);
QPrintDialog pd(&printer);
pd.setMinMax(1, doc->pages());
if(pd.exec() == QDialog::Accepted)
{
render.setPrinter(&printer);
render.render(doc);
}
}
}
示例5: slotPrintReport
void KexiReportView::slotPrintReport()
{
QPrinter printer;
ORPrintRender pr;
// do some printer initialization
pr.setPrinter(&printer);
pr.setupPrinter(m_reportDocument, &printer);
QPrintDialog *dialog = new QPrintDialog(&printer, this);
if (dialog->exec() != QDialog::Accepted)
return;
pr.render(m_reportDocument);
}
示例6: exportToPDF
bool ORPrintRender::exportToPDF(ORODocument * pDocument, QString pdfFileName)
{
if(!pDocument)
return false;
QPrinter printer(QPrinter::HighResolution);
#ifdef Q_WS_MAC
printer.setOutputFormat( QPrinter::NativeFormat );
#else
printer.setOutputFormat( QPrinter::PdfFormat );
#endif
printer.setOutputFileName( pdfFileName );
ORPrintRender render;
render.setupPrinter(pDocument, &printer);
render.setPrinter(&printer);
return render.render(pDocument);
}