summaryrefslogtreecommitdiffstats
path: root/src/printsupport
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-10-31 14:10:52 +0100
committerSergio Ahumada <sergio.ahumada@nokia.com>2011-10-31 20:21:49 +0100
commitfde3b2e93c1e5462660e84503a2370372de69bf3 (patch)
tree564e35f3492a95054b961a3d22366290b9b9c596 /src/printsupport
parent29478a8fe7f530d5d3fb728321cdf4e3191cad83 (diff)
Move QPrinter::init() to QPrinterPrivate::init()
This method is private, and only called from the QPrinter constructor. This also removes warnings about overloading the virtual QPaintDevice::init() method interitted form QWidget: ../../include/QtPrintSupport/../../src/printsupport/kernel/qprinter.h:259:10: warning: 'QPrinter::init' hides overloaded virtual function [-Woverloaded- void init(PrinterMode mode); ^ ../../include/QtGui/../../src/gui/painting/qpaintdevice.h:93:18: note: hidden overloaded virtual function 'QPaintDevice::init' declared here virtual void init(QPainter *painter) const; ^ Change-Id: I7c5203a1264b0ad825ed4075b66017fef22a40fb Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@kde.org>
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;