当前位置: 首页>>代码示例>>C++>>正文


C++ ORPrintRender::setPrinter方法代码示例

本文整理汇总了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;
  }
}
开发者ID:0TheFox0,项目名称:MayaOpenRPT,代码行数:57,代码来源:renderwindow.cpp

示例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;
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:28,代码来源:openreports.cpp

示例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;
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:30,代码来源:openreports.cpp

示例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);
    }
  }
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:35,代码来源:renderwindow.cpp

示例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);
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:15,代码来源:kexireportview.cpp

示例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);
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:20,代码来源:orprintrender.cpp


注:本文中的ORPrintRender::setPrinter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。