Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QPrinter::setOutputFormat ( OutputFormat  format  ) 

Since:
4.1
Sets the output format for this printer to format.

Definition at line 702 of file qprinter.cpp.

References QVariant::isValid(), and QPrintEngine::property().

Referenced by TextEdit::filePrintPdf(), setOutputFileName(), and setPrinterName().

{

#ifndef QT_NO_PDF
    Q_D(QPrinter);
    if (d->outputFormat == format)
        return;
    d->outputFormat = format;

    QPrintEngine *oldPrintEngine = d->printEngine;
    const bool def_engine = d->use_default_engine;
    d->printEngine = 0;

    d->createDefaultEngines();

    if (oldPrintEngine) {
        for (int i = 0; i < d->manualSetList.size(); ++i) {
            QPrintEngine::PrintEnginePropertyKey key = d->manualSetList[i];
            QVariant prop = oldPrintEngine->property(key);
            if (prop.isValid())
                d->printEngine->setProperty(key, prop);
        }
    }

    if (def_engine)
        delete oldPrintEngine;

    d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat;

#else
    Q_UNUSED(format);
#endif
}


Generated by  Doxygen 1.6.0   Back to index