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>
This commit is contained in:
parent
29478a8fe7
commit
fde3b2e93c
@ -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
|
||||
}
|
||||
|
@ -256,8 +256,6 @@ protected:
|
||||
void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
|
||||
|
||||
private:
|
||||
void init(PrinterMode mode);
|
||||
|
||||
Q_DISABLE_COPY(QPrinter)
|
||||
|
||||
QScopedPointer<QPrinterPrivate> d_ptr;
|
||||
|
@ -90,6 +90,8 @@ public:
|
||||
|
||||
}
|
||||
|
||||
void init(QPrinter::PrinterMode mode);
|
||||
|
||||
void createDefaultEngines();
|
||||
#ifndef QT_NO_PRINTPREVIEWWIDGET
|
||||
QList<const QPicture *> previewPages() const;
|
||||
|
Loading…
Reference in New Issue
Block a user