summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp12
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h2
-rw-r--r--src/printsupport/kernel/qprinter.cpp19
-rw-r--r--src/printsupport/kernel/qprinterinfo.cpp14
6 files changed, 21 insertions, 39 deletions
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 5564049c0d..ccbf52bb1e 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -200,18 +200,6 @@ QPlatformGLContext *QPlatformIntegration::createPlatformGLContext(QGuiGLContext
}
/*!
-
- Returns the platform's printing support.
-
- \since 5.0
-*/
-
-QPlatformPrinterSupport *QPlatformIntegration::printerSupport() const
-{
- return 0;
-}
-
-/*!
Returns the platforms input context.
The default implementation returns 0, implying no input method support.
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h
index b355f4ff12..3c903600f0 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration_qpa.h
@@ -58,7 +58,6 @@ class QPlatformBackingStore;
class QPlatformFontDatabase;
class QPlatformClipboard;
class QPlatformNativeInterface;
-class QPlatformPrinterSupport;
class QPlatformDrag;
class QPlatformGLContext;
class QGuiGLFormat;
@@ -98,8 +97,6 @@ public:
// Access native handles. The window handle is already available from Wid;
virtual QPlatformNativeInterface *nativeInterface() const;
- virtual QPlatformPrinterSupport *printerSupport() const;
-
protected:
void screenAdded(QPlatformScreen *screen);
};
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index e97b9f2121..a512fb2e19 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -48,8 +48,6 @@
#include "qxcbclipboard.h"
#include "qxcbdrag.h"
-#include <QtPlatformSupport/private/qgenericunixprintersupport_p.h>
-
#include <xcb/xcb.h>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
@@ -79,8 +77,7 @@
#include <QtGui/QScreen>
QXcbIntegration::QXcbIntegration(const QStringList &parameters)
- : m_printerSupport(new QGenericUnixPrinterSupport)
- , m_eventDispatcher(createUnixEventDispatcher())
+ : m_eventDispatcher(createUnixEventDispatcher())
{
QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
@@ -183,11 +180,6 @@ QPlatformNativeInterface * QXcbIntegration::nativeInterface() const
return m_nativeInterface;
}
-QPlatformPrinterSupport *QXcbIntegration::printerSupport() const
-{
- return m_printerSupport;
-}
-
QPlatformClipboard *QXcbIntegration::clipboard() const
{
return m_connections.at(0)->clipboard();
diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h
index 29835f493f..9d49a90d0a 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.h
+++ b/src/plugins/platforms/xcb/qxcbintegration.h
@@ -69,7 +69,6 @@ public:
QPlatformNativeInterface *nativeInterface()const;
- QPlatformPrinterSupport *printerSupport() const;
QPlatformClipboard *clipboard() const;
QPlatformDrag *drag() const;
@@ -80,7 +79,6 @@ private:
QPlatformFontDatabase *m_fontDatabase;
QPlatformNativeInterface *m_nativeInterface;
- QPlatformPrinterSupport *m_printerSupport;
QPlatformInputContext *m_inputContext;
QAbstractEventDispatcher *m_eventDispatcher;
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 72522b38c1..3f169755d8 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -52,7 +52,7 @@
#ifndef QT_NO_PRINTER
-#include <private/qguiapplication_p.h>
+#include "qplatformprintplugin_qpa.h"
#include <QtPrintSupport/QPlatformPrinterSupport>
#if defined (Q_WS_WIN)
@@ -158,19 +158,24 @@ Q_GUI_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientation,
void QPrinterPrivate::createDefaultEngines()
{
QPrinter::OutputFormat realOutputFormat = outputFormat;
-#if !defined (QTOPIA_PRINTENGINE)
#if defined (Q_OS_UNIX) && ! defined (Q_WS_MAC)
if(outputFormat == QPrinter::NativeFormat) {
realOutputFormat = QPrinter::PdfFormat;
}
#endif
-#endif
switch (realOutputFormat) {
case QPrinter::NativeFormat: {
#if defined (Q_WS_QPA)
- printEngine = QGuiApplicationPrivate::platformIntegration()->printerSupport()->createNativePrintEngine(printerMode);
- paintEngine = QGuiApplicationPrivate::platformIntegration()->printerSupport()->createPaintEngine(printEngine, printerMode);
+ QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
+ if (ps) {
+ printEngine = ps->createNativePrintEngine(printerMode);
+ paintEngine = ps->createPaintEngine(printEngine, printerMode);
+ } else {
+ QPdfPrintEngine *pdfEngine = new QPdfPrintEngine(printerMode);
+ paintEngine = pdfEngine;
+ printEngine = pdfEngine;
+ }
#elif defined (Q_WS_WIN)
QWin32PrintEngine *winEngine = new QWin32PrintEngine(printerMode);
paintEngine = winEngine;
@@ -179,10 +184,6 @@ void QPrinterPrivate::createDefaultEngines()
QMacPrintEngine *macEngine = new QMacPrintEngine(printerMode);
paintEngine = macEngine;
printEngine = macEngine;
-#elif defined (QTOPIA_PRINTENGINE)
- QtopiaPrintEngine *qwsEngine = new QtopiaPrintEngine(printerMode);
- paintEngine = qwsEngine;
- printEngine = qwsEngine;
#elif defined (Q_OS_UNIX)
Q_ASSERT(false);
#endif
diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp
index e48db449b5..5be73e76b9 100644
--- a/src/printsupport/kernel/qprinterinfo.cpp
+++ b/src/printsupport/kernel/qprinterinfo.cpp
@@ -30,7 +30,7 @@
#ifndef QT_NO_PRINTER
-#include <private/qguiapplication_p.h>
+#include "qplatformprintplugin_qpa.h"
#include <QtPrintSupport/QPlatformPrinterSupport>
QT_BEGIN_NAMESPACE
@@ -176,7 +176,7 @@ QList<QPrinter::PaperSize> QPrinterInfo::supportedPaperSizes() const
{
const Q_D(QPrinterInfo);
if (!isNull() && !d->hasPaperSizes) {
- d->paperSizes = QGuiApplicationPrivate::platformIntegration()->printerSupport()->supportedPaperSizes(*this);
+ d->paperSizes = QPlatformPrinterSupportPlugin::get()->supportedPaperSizes(*this);
d->hasPaperSizes = true;
}
return d->paperSizes;
@@ -184,12 +184,18 @@ QList<QPrinter::PaperSize> QPrinterInfo::supportedPaperSizes() const
QList<QPrinterInfo> QPrinterInfo::availablePrinters()
{
- return QGuiApplicationPrivate::platformIntegration()->printerSupport()->availablePrinters();
+ QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
+ if (!ps)
+ return QList<QPrinterInfo>();
+ return ps->availablePrinters();
}
QPrinterInfo QPrinterInfo::defaultPrinter()
{
- return QGuiApplicationPrivate::platformIntegration()->printerSupport()->defaultPrinter();
+ QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
+ if (!ps)
+ return QPrinterInfo();
+ return QPlatformPrinterSupportPlugin::get()->defaultPrinter();
}
#endif //Q_WS_QPA