summaryrefslogtreecommitdiffstats
path: root/src/printsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/printsupport')
-rw-r--r--src/printsupport/kernel/qprinter.cpp23
-rw-r--r--src/printsupport/kernel/qprinter.h2
-rw-r--r--src/printsupport/kernel/qprinter_p.h2
3 files changed, 13 insertions, 14 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index d748bbddbf..252ebd1bd9 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -549,7 +549,7 @@ QPrinter::QPrinter(PrinterMode mode)
: QPagedPaintDevice(),
d_ptr(new QPrinterPrivate(this))
{
- init(mode);
+ d_ptr->init(mode);
QPrinterInfo defPrn(QPrinterInfo::defaultPrinter());
if (!defPrn.isNull()) {
setPrinterName(defPrn.printerName());
@@ -569,11 +569,11 @@ QPrinter::QPrinter(const QPrinterInfo& printer, PrinterMode mode)
: QPagedPaintDevice(),
d_ptr(new QPrinterPrivate(this))
{
- init(mode);
+ d_ptr->init(mode);
setPrinterName(printer.printerName());
}
-void QPrinter::init(PrinterMode mode)
+void QPrinterPrivate::init(QPrinter::PrinterMode mode)
{
#if !defined(Q_WS_X11)
if (!QCoreApplication::instance()) {
@@ -583,22 +583,21 @@ void QPrinter::init(PrinterMode mode)
qFatal("QPrinter: Must construct a QApplication before a QPaintDevice");
return;
}
- Q_D(QPrinter);
- d->printerMode = mode;
- d->outputFormat = QPrinter::NativeFormat;
- d->createDefaultEngines();
+ printerMode = mode;
+ outputFormat = QPrinter::NativeFormat;
+ createDefaultEngines();
#ifndef QT_NO_PRINTPREVIEWWIDGET
- d->previewEngine = 0;
+ previewEngine = 0;
#endif
- d->realPrintEngine = 0;
- d->realPaintEngine = 0;
+ realPrintEngine = 0;
+ realPaintEngine = 0;
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
if (QCUPSSupport::cupsVersion() >= 10200 && QCUPSSupport().currentPPD()) {
- setOutputFormat(QPrinter::PdfFormat);
- d->outputFormat = QPrinter::NativeFormat;
+ q_func()->setOutputFormat(QPrinter::PdfFormat);
+ outputFormat = QPrinter::NativeFormat;
}
#endif
}
diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h
index 7d04099a8f..f09a4cc798 100644
--- a/src/printsupport/kernel/qprinter.h
+++ b/src/printsupport/kernel/qprinter.h
@@ -256,8 +256,6 @@ protected:
void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
private:
- void init(PrinterMode mode);
-
Q_DISABLE_COPY(QPrinter)
QScopedPointer<QPrinterPrivate> d_ptr;
diff --git a/src/printsupport/kernel/qprinter_p.h b/src/printsupport/kernel/qprinter_p.h
index 08877f08c5..362202fe32 100644
--- a/src/printsupport/kernel/qprinter_p.h
+++ b/src/printsupport/kernel/qprinter_p.h
@@ -90,6 +90,8 @@ public:
}
+ void init(QPrinter::PrinterMode mode);
+
void createDefaultEngines();
#ifndef QT_NO_PRINTPREVIEWWIDGET
QList<const QPicture *> previewPages() const;