Add an invokable method that takes the QPrintEngine (which will
always be a QMacPrintEngine) and return the NSPrintInfo* from the
QMacPrintEnginePrivate. This will be used by the native dialogs in
QtPrintSupport to get/set printer settings.
Change-Id: If1e49027e8f0d505656db51be1f40a23f60e8e57
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
plugin.
*/
Q_INVOKABLE QPlatformPrinterSupport *createPlatformPrinterSupport();
+ /*
+ Function to return the NSPrintInfo * from QMacPaintEnginePrivate.
+ Needed by the native print dialog in the QtPrintSupport library.
+ */
+ Q_INVOKABLE void *NSPrintInfoForPrintEngine(QPrintEngine *printEngine);
};
#endif // QCOCOANATIVEINTERFACE_H
#include "qopenglcontext.h"
#include <qdebug.h>
+#include "qprintengine_mac_p.h"
+
void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
{
if (!window->handle()) {
{
return new QCocoaPrinterSupport();
}
+
+void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
+{
+ QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
+ return macPrintEngine->d_func()->printInfo;
+}
virtual void drawTextItem(const QPointF &p, const QTextItem &ti);
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
virtual void drawPath(const QPainterPath &);
+
+private:
+ friend class QCocoaNativeInterface;
};
class QMacPrintEnginePrivate : public QPaintEnginePrivate