Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpaintengine_preview_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QPAINTENGINE_PREVIEW_P_H
6#define QPAINTENGINE_PREVIEW_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of QPreviewPrinter and friends. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18//
19
20#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
21#include <QtGui/qpaintengine.h>
22#include <QtPrintSupport/qprintengine.h>
23
25
26QT_BEGIN_NAMESPACE
27
28class QPreviewPaintEnginePrivate;
29
31{
33public:
36
37 bool begin(QPaintDevice *dev) override;
38 bool end() override;
39
40 void updateState(const QPaintEngineState &state) override;
41
42 void drawPath(const QPainterPath &path) override;
43 void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
44 void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
45
46 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
47 void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &p) override;
48
49 QList<const QPicture *> pages();
50
51 QPaintEngine::Type type() const override { return Picture; }
52
53 void setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
54
55 void setProperty(PrintEnginePropertyKey key, const QVariant &value) override;
56 QVariant property(PrintEnginePropertyKey key) const override;
57
58 bool newPage() override;
59 bool abort() override;
60
61 int metric(QPaintDevice::PaintDeviceMetric) const override;
62
63 QPrinter::PrinterState printerState() const override;
64};
65
66QT_END_NAMESPACE
67
68#endif
void drawPath(const QPainterPath &path) override
The default implementation ignores the path and does nothing.
void setProxyEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine)
bool begin(QPaintDevice *dev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
QList< const QPicture * > pages()
void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override
Reimplement this virtual function to draw the polygon defined by the pointCount first points in point...
bool abort() override
Instructs the print engine to abort the printing process.
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
This function draws the text item textItem at position p.
QPaintEngine::Type type() const override
Reimplement this function to return the paint engine \l{Type}.
bool end() override
Reimplement this function to finish painting on the current paint device.
QVariant property(PrintEnginePropertyKey key) const override
Returns the print engine's property specified by key.
void updateState(const QPaintEngineState &state) override
Reimplement this function to update the state of a paint engine.
QPrinter::PrinterState printerState() const override
Returns the current state of the printer being used by the print engine.
int metric(QPaintDevice::PaintDeviceMetric) const override
Returns the metric for the given id.
bool newPage() override
Instructs the print engine to start a new page.
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &p) override
Reimplement this function to draw the pixmap in the given rect, starting at the given p.
void setProperty(PrintEnginePropertyKey key, const QVariant &value) override
Sets the print engine's property specified by key to the given value.
QT_REQUIRE_CONFIG(printpreviewwidget)