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


C++ QPrinter类代码示例

本文整理汇总了C++中QPrinter的典型用法代码示例。如果您正苦于以下问题:C++ QPrinter类的具体用法?C++ QPrinter怎么用?C++ QPrinter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QPrinter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fullPage

bool QPrinterProto::fullPage() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->fullPage();
  return false;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例2: fontEmbeddingEnabled

bool QPrinterProto::fontEmbeddingEnabled() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->fontEmbeddingEnabled();
  return false;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例3: fromPage

int QPrinterProto::fromPage() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->fromPage();
  return 0;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例4: doubleSidedPrinting

bool QPrinterProto::doubleSidedPrinting() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->doubleSidedPrinting();
  return false;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例5: duplex

QPrinter::DuplexMode QPrinterProto::duplex() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->duplex();
  return QPrinter::DuplexNone;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例6: colorMode

QPrinter::ColorMode QPrinterProto::colorMode() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->colorMode();
  return QPrinter::Color;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例7: docName

QString QPrinterProto::docName() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->docName();
  return QString();
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例8: collateCopies

bool QPrinterProto::collateCopies() const
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->collateCopies();
  return false;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例9: abort

bool QPrinterProto::abort()
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    return item->abort();
  return false;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:7,代码来源:qprinterproto.cpp

示例10: tr

void Matrix::exportVector(const QString& fileName, int res, bool color)
{
	if ( fileName.isEmpty() ){
		QMessageBox::critical(this, tr("QtiPlot - Error"), tr("Please provide a valid file name!"));
        return;
	}

	QPrinter printer;
    printer.setCreator("QtiPlot");
	printer.setFullPage(true);
	if (res)
		printer.setResolution(res);

    printer.setOutputFileName(fileName);
    if (fileName.contains(".eps"))
    	printer.setOutputFormat(QPrinter::PostScriptFormat);

    if (color)
		printer.setColorMode(QPrinter::Color);
	else
		printer.setColorMode(QPrinter::GrayScale);

	printer.setOrientation(QPrinter::Portrait);

    int cols = numCols();
    int rows = numRows();
    QRect rect = QRect(0, 0, cols, rows);
    printer.setPaperSize(QSizeF(cols, rows), QPrinter::DevicePixel);

    QPainter paint(&printer);
    paint.drawImage(rect, d_matrix_model->renderImage());
    paint.end();
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:33,代码来源:Matrix.cpp

示例11: filePrint

void Help::filePrint()
{
    QPrinter printer;
    printer.setFullPage(TRUE);
    if ( printer.setup() ) {
	QPainter p( &printer );
	QPaintDeviceMetrics metrics(p.device());
	int dpix = metrics.logicalDpiX();
	int dpiy = metrics.logicalDpiY();
	const int margin = 72; // pt
	QRect body(margin*dpix/72, margin*dpiy/72,
		   metrics.width()-margin*dpix/72*2,
		   metrics.height()-margin*dpiy/72*2 );
	QFont font("times", 10);
	QSimpleRichText richText( browser->text(), font, browser->context(), browser->styleSheet(),
				  browser->mimeSourceFactory(), body.height() );
	richText.setWidth( &p, body.width() );
	QRect view( body );
	int page = 1;
	do {
	    richText.draw( &p, body.left(), body.top(), view, colorGroup() );
	    view.moveBy( 0, body.height() );
	    p.translate( 0 , -body.height() );
	    p.setFont( font );
	    p.drawText( view.right() - p.fontMetrics().width( QString::number(page) ),
			view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page) );
	    if ( view.top()  >= richText.height() )
		break;
	    printer.newPage();
	    page++;
	} while (TRUE);
    }
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:33,代码来源:help.cpp

示例12: printerSelectionOption

int Printer::printerSelectionOption(lua_State * L) // const : QString 
{
	QPrinter* lhs = ValueBinding<MyQPrinter>::check( L, 1 );
#ifndef _WIN32
	*QtValue<QString>::create( L ) = lhs->printerSelectionOption();
#endif
	return 1; 
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:8,代码来源:QtlPrinter.cpp

示例13: setPrinterSelectionOption

int Printer::setPrinterSelectionOption(lua_State * L) // ( const QString & option )
{
	QPrinter* lhs = ValueBinding<MyQPrinter>::check( L, 1 );
#ifndef _WIN32
	lhs->setPrinterSelectionOption( QtValueBase::toString( L, 2 ));
#endif
	return 0;
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:8,代码来源:QtlPrinter.cpp

示例14: savePdf

void SchedulePrintDialog::savePdf()
{
	QPrinter printer;
	setupPdfPrinter(printer);
	QString fileName = QFileDialog::getSaveFileName(this, "Choose File Name for Pdf", QString(), "Pdf Documents (*.pdf)" );
	printer.setOutputFileName( fileName );
	doPrint(&printer);
}
开发者ID:EntityFXCode,项目名称:arsenalsuite,代码行数:8,代码来源:scheduleprintdialog.cpp

示例15: exportToPdf

//-------------------------------------------------------------------------
void QGuidoItemContainer::exportToPdf(const QString& fileName)
{
	QPrinter printer;
	printer.setFullPage(true);
	printer.setOutputFileName( fileName );
	printer.setOutputFormat( QPrinter::PdfFormat );
	exportToPdf( &printer );
}
开发者ID:EQ4,项目名称:guido-engine,代码行数:9,代码来源:QGuidoItemContainer.cpp


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