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


C++ QPrinter::printerName方法代码示例

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


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

示例1: destination

QStringList FilePrinter::destination( QPrinter &printer, const QString &version )
{
    if ( version == QLatin1String("lp") ) {
        return QStringList(QStringLiteral("-d")) << printer.printerName();
    }

    if ( version.startsWith( QLatin1String("lpr") ) ) {
        return QStringList(QStringLiteral("-P")) << printer.printerName();
    }

    return QStringList();
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例2: printerName

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

示例3: QPrinterInfoPrivate

/*!
    Constructs a QPrinterInfo object from \a printer.
*/
QPrinterInfo::QPrinterInfo(const QPrinter &printer)
    : d_ptr(&QPrinterInfoPrivate::shared_null)
{
    QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
    if (ps) {
        QPrinterInfo pi = ps->printerInfo(printer.printerName());
        d_ptr.reset(new QPrinterInfoPrivate(*pi.d_ptr));
    }
}
开发者ID:crobertd,项目名称:qtbase,代码行数:12,代码来源:qprinterinfo.cpp

示例4: foreach

/*!
    Constructs a QPrinterInfo object from \a printer.
*/
QPrinterInfo::QPrinterInfo(const QPrinter &printer)
    : d_ptr(&QPrinterInfoPrivate::shared_null)
{
    foreach (const QPrinterInfo &printerInfo, availablePrinters()) {
        if (printerInfo.printerName() == printer.printerName()) {
            d_ptr.reset(new QPrinterInfoPrivate(*printerInfo.d_ptr));
            break;
        }
    }
}
开发者ID:maxxant,项目名称:qt,代码行数:13,代码来源:qprinterinfo.cpp

示例5: pi

/*!
    Constructs a QPrinterInfo object from \a printer.
*/
QPrinterInfo::QPrinterInfo(const QPrinter &printer)
    : d_ptr(shared_null)
{
    QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
    if (ps) {
        QPrinterInfo pi(printer.printerName());
        if (pi.d_ptr.data() == shared_null)
            d_ptr.reset(shared_null);
        else
            d_ptr.reset(new QPrinterInfoPrivate(*pi.d_ptr));
    }
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:15,代码来源:qprinterinfo.cpp

示例6: print

void DocuWindow::print()
{
    QPrinter printer;
    if (printer.printerName().isEmpty()) {
	statusBar()->showMessage(tr("No printer installed"), 2000);
	return;
    }

    QPrintDialog printDialog(&printer, this);
    if (!printDialog.exec()) {
	statusBar()->showMessage(tr("Printing aborted"), 2000);
	return;
    }

    browser->document()->print(&printer);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:16,代码来源:docuwindow.cpp

示例7: printFormHelper

void QtDesignerChild::printFormHelper( QDesignerFormWindowInterface* form, bool quick )
{
    bool ok;
    const QStringList styles = QStyleFactory::keys();
    const int id = styles.indexOf( pStylesActionGroup::systemStyle() );
    QString style = QInputDialog::getItem( this, tr( "Choose a style..." ), tr( "Choose a style to render the form:" ), styles, id, false, &ok );

    if ( !ok )
    {
        return;
    }

    // get printer
    QPrinter printer;

    // if quick print
    if ( quick )
    {
        // check if default printer is set
        if ( printer.printerName().isEmpty() )
        {
            MonkeyCore::messageManager()->appendMessage( tr( "There is no default printer, please set one before trying quick print" ) );
            return;
        }

        // print and return
        QPainter painter( &printer );
        painter.drawPixmap( 0, 0, mDesignerManager->previewPixmap( form, style ) );
    }
    else
    {
        // printer dialog
        QPrintDialog printDialog( &printer );

        // if ok
        if ( printDialog.exec() )
        {
            // print and return
            QPainter painter( &printer );
            painter.drawPixmap( 0, 0, mDesignerManager->previewPixmap( form, style ) );
        }
    }
}
开发者ID:pasnox,项目名称:monkeystudio2,代码行数:43,代码来源:QtDesignerChild.cpp

示例8: Print

/*
*Function: Print
*Inputs:none
*Outputs:none
*Returns:none
*/
void GraphPaneData::Print()
{
	IT_IT("GraphPaneData::Print");
	
	QPrinter prt; 
	prt.setDocName(tr("Pen Trace"));
	prt.setCreator(tr(SYSTEM_NAME));
	prt.setOrientation(QPrinter::Landscape);
	prt.setOutputFileName("~out.ps");
	prt.setOutputToFile(false);
	//
	if(prt.setup(this))
	{
		//
		// Handle the case of no printer being selected
		//
		if(!prt.printerName().isEmpty())
		{
			QPainter p;
			p.begin(&prt);
			QPaintDeviceMetrics metrics(p.device());
			//
			int dpix = metrics.logicalDpiX() ; //  inch border
			int dpiy = metrics.logicalDpiY() ;
			//
			QRect body(dpix, dpiy,	metrics.width()  -  dpix*6,	metrics.height() -  dpiy*2);
			TheGraph.Plot(p,body,Qt::white);
			//
			QFont font("times", 8); 
			p.setFont(font);
			//
			p.drawText( body.left() ,body.top(), Title);
			//
			p.end();
			//
		}
		else
		{
			QMessageBox::information(this,tr("Print Graph Error"),tr("No Printer Selected!"));
		};
	};
};
开发者ID:jiajw0426,项目名称:easyscada,代码行数:48,代码来源:graphpanedata.cpp

示例9: print

void DocuWindow::print()
{
#ifdef QT_NO_PRINTER
    Q_UNIMPLEMENTED();
#else
    QPrinter printer;
    if (printer.printerName().isEmpty()) {
	statusBar()->showMessage(tr("No printer installed"), 2000);
	return;
    }

    QPrintDialog printDialog(&printer, this);
    if (!printDialog.exec()) {
	statusBar()->showMessage(tr("Printing aborted"), 2000);
	return;
    }

    browser->document()->print(&printer);
#endif
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:20,代码来源:docuwindow.cpp

示例10: printerName

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


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